7 ms·
only needs one point, "only use javascript when you have to, it's a terrible language and best avoided"
by n0body 12y ago
only needs one point, "only use javascript when you have to, it's a terrible language and best avoided"
- dmak 12y agoWhy do you think its terrible?
- n0body 12y agothe + operator, is it concatting strings, or adding? who knows. the scoping sucks, e.g. (function() { var x = 1; console.log( x ); if ( x ) { var y = 2; } console.log( y ); })() why is y defined? its being called out of the block it was declared in? there's no proper foreach using other files is an effort and requires hacks to get them loaded. callbacks everywhere. variable names as object keys is a pain regex is a pita i just don't like it, i have no idea why it's become so popular recently, i can understand it runs in the browser and everyone has a browser, but why server side stuff? but whatever, each to their own i guess
- nhenezi 12y ago> why is y defined? its being called out of the block it was declared in? Javascript doesn't have block scope; above example is equivalent to: (function() { var x, y; x = 1; console.log( x ); if ( x ) { y = 2; } console.log( y ); })() Variable declarations are always hoisted to the top of containing scope.