Program name: Difference between revisions

→‎{{header|JavaScript}}: marked incorrect
No edit summary
(→‎{{header|JavaScript}}: marked incorrect)
Line 976:
 
=={{header|JavaScript}}==
{{incorrect|JavaScript|Program name, not function name. Show sample output.}}
 
<small><i>Suggestion: document.location.href is probably closer to task requirements (and better than a script name), plus arguments.callee.name is long dead. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 23:29, 24 March 2022 (UTC)</i></small><br>
There is no capability within the ECMA-262 standard (the standard for ECMAScript, the language underlying JavaScript) for a function to determine its name. Since objects in JavaScript are first class objects, variables and properties are only references to objects. The name of an object might be said to be the name used to reference it, however a single object may have many variables and properties that reference it, or none.
 
7,794

edits