recently i found some operators in Javascript looks:
=>
.
I tried to look it up on Google, but cannot find any explanation. Is there someone who knows about this operator?
recently i found some operators in Javascript looks:
=>
.
I tried to look it up on Google, but cannot find any explanation. Is there someone who knows about this operator?
That is called arrow function
You can read more here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions#Arrow_functions
var a = [
"Hydrogen",
"Helium",
"Lithium",
"Beryllium"
];
var a2 = a.map(function(s){ return s.length });
var a3 = a.map( s => s.length );