ECMAScript 6's function.name property
问题 Quick question: what's the correct result for this code: let f = function(){}; let n = f.name; //"" or "f"? According to the compat table, n should have the value "f" . However, the mozilla docs say that it should return an empty string. Which one is correct? 回答1: Since ECMAScript 6 is currently in draft state, the answer below may become outdated sometime in the future. That being said, referencing the spec draft: Anonymous functions objects that do not have a contextual name associated with