[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Function/displayName [Back]  [Original]

Function: displayName - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Function: displayName

: . . .

Function displayName .

In this article

displayName . , .

displayName name .

. displayName .

JavaScript displayName .

  • displayName _ , $ , .
  • displayName [] , .
  • displayName _ /, ., < , /, ., < .
  • displayName _ (^) , (^) .

displayName .

, function MyFunction() .

js
const a = function () {};
a.displayName = "MyFunction";

a; // function MyFunction()

displayName .

js
const object = {
  // 
  someMethod: function someMethod(value) {
    someMethod.displayName = `someMethod (${value})`;
  },
};

console.log(object.someMethod.displayName); // undefined

object.someMethod("123");
console.log(object.someMethod.displayName); // "someMethod (123)"

displayName .

js
function foo() {}

function testName(name) {
  foo.displayName = name;
  console.log(foo);
}

testName("$foo$"); // function $foo$()
testName("foo bar"); // function bar()
testName("Foo.prototype.add"); // function add()
testName("foo ."); // function foo .()
testName("foo <"); // function foo <()
testName("foo?"); // function foo?()
testName("foo()"); // function foo()()

testName("[...]"); // function ...()
testName("foo<"); // function foo()
testName("foo..."); // function foo()
testName("foo(^)"); // function foo()

Not part of any standard.


Web Proxy Viewer  |  New URL  |  Original Page