Language/JS, TS [Typescript] 구조적 타이핑 [구조적 타이핑] Typescript 의 타입 호환성은 구조적 타이핑을 지원합니다. 여기서 구조적 타이핑이란 X 와 Y 라는 타입이 '구조적' 으로 동일하다면 X 와 Y 는 호환 가능한 타입이 될 수 있다고 여길 수 있는 것을 의미합니다. interface A { id : number } interface B { id : number } let a : A; let b : B = { id: 5, } a = b //OK a는 A 타입 으로 선언되었지만 '구조적'으로 동일한 B 타입의 객체를 대입하더라도 에러를 내지 않습니다. interface A { id : number } interface B { id : number name : string } let a : A; let b : B = { id: 5, n.. Language/JS, TS 2022. 9. 1. Array.from() MDN Array.from docs Array.from() - JavaScript | MDN Array.from() 메서드는 유사 배열 객체(array-like object)나 반복 가능한 객체(iterable object)를 얕게 복사해 새로운Array 객체를 만듭니다. developer.mozilla.org Array-like 객체 나 iterable 객체를 얉은 복사로 새 Array 객체에 할당하는 메서드 단순하게 Array를 만드는 메서드로 알고있었는데 첫번째 매개변수의 length 속성에 값을 지정해주고 arrow function 을 사용하면 순차 숫자 배열(?) 을 쉽게 만들 수 있다. example // Using an arrow function as the map function to //.. Language/JS, TS 2022. 7. 7. [Error] tsconfig.json: Build:No inputs were found in config file https://stackoverflow.com/questions/41211566/tsconfig-json-buildno-inputs-were-found-in-config-file tsconfig.json: Build:No inputs were found in config file I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Spe... stackoverflow.com Language/JS, TS 2022. 6. 15. 이전 1 다음