var a = [1, 2, 3];
var b = n => n + 5;
var wtf = 'map'
a[wtf](b); // Array(3) [ 6, 7, 8 ]
a['map'](b); // Array(3) [ 6, 7, 8 ]
I don't understand the general principle behind it and can't figure out what is it called so I can look it up.
var a = [1, 2, 3];
var b = n => n + 5;
var wtf = 'map'
a[wtf](b); // Array(3) [ 6, 7, 8 ]
a['map'](b); // Array(3) [ 6, 7, 8 ]
I don't understand the general principle behind it and can't figure out what is it called so I can look it up.