In ECMA 2015 names are inferred.
This property is read only and cannot be changed by the assignment operator.

The variable the function expression is assigned to will have a 'name' property

var aa = function() {} 
console.log(aa.name); // aa

The name will not change if it is assigned to another variable

var bb = aa; 
console.log(bb.name); // aa

If the function name is present then the name will be the function name.
If the function name is anonmous the variable name will be used.

var cc = function dd() {}; 
console.log(cc.name); // dd

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext