---
title: "190701-TIL"
date: 2019-07-01
tags: ["TIL"]
url: https://sub2n.github.io/2019/07/01/190701-TIL/
---

# 190701-TIL

## Today Test

\[오답\]

-   식별자를 검색했을 때 없으면 ReferenceError지만 **Property를 검색했을 때 없으면** error가 아니고 **undefined를 리턴**
    
-   함수가 아닌 것에 () 붙여 실행하면 TypeError (SyntaxError 아님!!!!!!)
    
-   undefined 값에 method 실행해도 TypeError
    
-   typeof 배열은 object
    
    ```js
    function getAge(...args) {
      console.log(typeof args);
    }
    getAge(20);
    ```
    
    -   **Spread operator …**가 argument에서 사용되면 Object나 Array를 풀어서 함수의 argument로 전달
        
    -   **Rest parameter …** 를 사용하면 풀어진 argument를 하나의 배열로 받음
        
-   ‘use strict’
    
    ```js
    function getAge() {
      'use strict';
      age = 20;
      console.log(age);
    }
    ```
    
    ‘use strict’ mode가 아닐 때는 키워드 없이 선언한 변수를 암묵적 전역 변수로 등록하지만, ‘use strict’ mode에서는 식별자를 찾고 없으면 ReferenceError 발생
    

## Angular HttpClient

-   어떤 element의 값으로 일을 하고 그 값을 수정해야할 때 ngModel 양방향 바인딩 사용