Very simple thing I am trying to do in JS (assign the values of one array to another), but somehow the array bar\'s value doesn\'t seem affected at all.
bar
In ES6 you can use Array.from:
var ar = ["apple","banana","canaple"]; var bar = Array.from(ar); alert(bar[1]); // alerts 'banana'