JAMONGPROJECT

자바스크립트 예약어 모음 본문

Frontend/JAVASCRIPT

자바스크립트 예약어 모음

JAMONGPROJECT 2022. 5. 14. 19:49

자바스크립트에서 객체의 프로퍼티명을 예약어로 사용할 수는 있지만, 사용을 지양하자.

만약 사용하게 된다면 프로퍼티명에 따옴표를 표시해준다.

 

const ex1 = {
    name : 'domado',
    first-name: 'yoon', // -는 연산자이기때문에 문법 에러가 발생한다.
    'first-name': 'yoon', // ok
    age : '18',
    case : 'object', // syntax error
    'case' : 'object' // ok

}

 

 

abstract   arguments

 

boolean   break   byte

 

case   catch   char   class   const   continue

 

debugger   default   delete   do   double

 

else   enum   eval   export   extends

 

false   final   finally   float   for   function

 

goto

 

if   implements   import   in   instanceof   int   interface

 

let   long

 

native   new   null

 

package   private   protected   public

 

return

 

short   static   super   switch   synchronized

 

this   throw   throws   transient   true   try   typeof

 

var   void   volatile

 

while   with

 

yield

 

출처 : https://poiemaweb.com/js-object

'Frontend > JAVASCRIPT' 카테고리의 다른 글

자바스크립트 Set(집합)  (0) 2022.05.14
Falsy / Truthy  (0) 2022.05.06
삼항 조건 연산자(conditional ternary operator) (aka. if문 축약)  (0) 2022.05.06
IndexedDB  (0) 2022.04.27
동기 / 비동기  (0) 2022.04.26
Comments