function name에 관해서 꿀잼 포인트

👊0👊·2020년 7월 11일
0
  1. function.name은 함수의 이름을 나타내는 프로퍼티이다.

  2. es6의 스펙이다

  3. descriptor는 아래와 같다. 읽기 전용이고 열거되지 않는다.
    다만 설정을 변경할 수 있어서, 이름을 변경할 수 있다.

Writable	no
Enumerable	no
Configurable	yes
  1. Function.prototype의 name은 [Symbol.hasInstance]이다.

The value of the "name" property of this function is "[Symbol.hasInstance]".
Fo

  1. name은 function instance의 property다. 명세에는 아래와 같다.

The value of the "name" property is a String that is descriptive of the function. The name has no semantic significance but is typically a variable or property name that is used to refer to the function at its point of definition in ECMAScript code. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.

Anonymous functions objects that do not have a contextual name associated with them by this specification use the empty String as the value of the "name" property.

  1. string type이다. typeof f1.name === 'string'
  2. 구문적 중요성은 없다.
  3. 하지만 es가 함수를 사용할 수 있게 알려주는 포인트이다.
  4. 익명함수의 name값은 ''이다.
profile
ㅎㅎ

0개의 댓글