I've being seeing that the Arrow functions are the ES6 version of (normal) Javascript functions. Is it correct ? Or are they the ES6 version of anonymous functions ?
// Normal Function
function oldOne() {
console.log("Hello World..!");
}
//Anonymous function
var anonym = function(){
console.log("Hello World..!");
}
// ES6
var arrowFun = () => {
console.log("Hello World..!");
}
In above code snippet, if we run each function before it's declaration, only normal function would give the output( Hello World..! ) right ? So, if arrow functions are the new version of normal function it also should give the same output (instead of giving an error, like anonymous functions do).
So I just wanted to clarify whether they're ES6 version of Normal Functions or Anonymous Functions ?