JavaScript Beautiful Code Part #2/3 - Proper Coding - Avoiding Implicit Type Conversion

Posted at

icompile.eladkarako.com_i_always_follow_the_proper_dress_codeMaybe only best used @ the end-point compile-script) to minify/obfuscate your code even more..

point mentioning that those *might* gives you a little street credit, but are considered a really bad practice,
and in no-way you should use those in actual live-code, at least, out of common courtesy for your fellow developers :]

icompile.eladkarako.com_beautiful_code_animation




  • :( x = !!y;


  • :) x = Boolean(y);









  • :( x = +y;


  • :) x = Number(y);









  • :( x = '' + y;


  • :) x = String(y);









  • :( x = ~s.indexOf('.');


  • :) x = s.indexOf('.') !== -1;




consider reading more about:
- JSCS (JavaScript Code Style)https://www.npmjs.com/package/jscs
- GJSLint (Google JavaScript Linter) https://developers.google.com/closure/utilities/docs/linter_howto

if you see those abominations,
be a pal, and fix it :)