4 ms·
Javascript and C. Neither are considered pinnacles of language design.
by Macha 5y ago
Javascript and C.
Neither are considered pinnacles of language design.
- kevinmgranger 5y agoJavascript requires explicit variable declaration if you're bringing it to a new scope, though. Which is to say: var s = "Geeksforgeeks"; function f_global() { s = "Me too"; } // is different from function f_local() { var s = "Me too"; }
- sgc 5y agoI like that better (and I realize I might be alone!). But I don't like that you can declare a global variable in a local function by omitting the var. It's a similar needless ambiguity and frankly much more prone to errors than the python local variable initialization. At least there is strict mode.