[hr][/hr]
So, what you think about these recent happenings in JavaScript?
Do you hate closures, do you love regular expressions (weirdo!), or is Twitter Bootstrap the best thing since sliced bread?
Let us know and the debate can begin.
This works because in JavaScript parameters are passed by value, rather than by reference.
JavaScript is a pass by value language, and the i inside the function is a different chunk of memory than the i from the loop.
He’s wrong. Only primary types: string, number, boolean are passed by value. Complex types: array, function, object are passed by reference. He also should get the name shadowing concept first.
function changeNum(y) {
y++;
console.log(y); // y value is 2 after changeNum(x)
}
function changeObj(o) {
o.one = "two";
}
var x = 1;
var obj = {one: "one"};
changeNum(x); // pass by value; it doesn't affect x
changeObj(obj); // pass by reference; it affects obj directly
console.log(x); // x value remains 1
console.log(obj); // obj's one property is changed to "two"
Note: You can write Dart apps using any recent version of Windows (Vista, 7, or 8), Linux, or Mac. The Dart development tools do not support Windows XP. Dart Editor requires Java version 6 or higher.
I can understand Windows XP not being supported. But Java requirements are just too much for me. Never really got Java on my good side.