사용자 도구

사이트 도구


typescript:deep:type

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
typescript:deep:type [2019/11/23 04:24] – [Solution 2 - Function] taekgutypescript:deep:type [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1
줄 45: 줄 45:
 Now, as your projets goes on, you have whole idea of what's going on there. So you can go back and modify your declaration to a more precise version using the fancy arrow function syntax, feel free to use it, it maked as 'standard' in ECMA2015. Now, as your projets goes on, you have whole idea of what's going on there. So you can go back and modify your declaration to a more precise version using the fancy arrow function syntax, feel free to use it, it maked as 'standard' in ECMA2015.
  
 +이제, 당신의 프로젝트가 진행됨에 따라, 당신은 거기에 대한 전체를 알고 있다. 그래서 당신은 뒤로 돌아가 당신의 선언를 연습버젼에서 화려한 화살표 함수문법으로 수정할 수 있다. 화살표함수는 ECMA2015에서 표준이 되었다.
 <Code:typescript> <Code:typescript>
 let a: (para: string) => string; let a: (para: string) => string;
줄 54: 줄 55:
 The syntax here is very simple, it is just like the lambda function in Java or C#, the 'string' after the arrow is the type of the return value. The para: string defines the type of the parameter. It takes a ''string'' and return a ''string''. The syntax here is very simple, it is just like the lambda function in Java or C#, the 'string' after the arrow is the type of the return value. The para: string defines the type of the parameter. It takes a ''string'' and return a ''string''.
  
 +여기 문법은 매우 단순하고, 이것은 자바와 씨샵의 라므다 함수와 유사하게 화살표후의 'string'은 반환값의 타입이다. 'para: string'은 파라메터의 타입을 선어한다. 이것은 ''문자열''을 받아서 ''문자열''을 반환한다.
 ==== Solution 4 - Use type ==== ==== Solution 4 - Use type ====
  
 We can use ''type'' to declare a function type: We can use ''type'' to declare a function type:
 +
 +''type''을 이용하여 함수 타입을 선언할 수 있다.
  
 <Code:typescript> <Code:typescript>
줄 68: 줄 72:
  
 We are Typescript, we'd love to use the beloved ''interface'' for everything, well, you can, for just a function. We are Typescript, we'd love to use the beloved ''interface'' for everything, well, you can, for just a function.
 +우리는 타입스크립트에서는, 우리는 모든 것에 대해서 사랑하는 ''interface''를 사용를 선호한다. 글쎄, 당신은 함수에 대해서도 할 수 있다.
 <Code:typescript> <Code:typescript>
 interface read { interface read {
줄 78: 줄 83:
 ==== Summary ==== ==== Summary ====
  
-In pratice, I often use ''Solution 4 - Type''. Maybe juse because it looks simpler than ''interface'' version.+In pratice, I often use ''Solution 4 - Type''. Maybe just because it looks simpler than ''interface'' version.
  
 +경험적으로 나는 4번 Type을 선호한다. 아마도 ''interface''버전보다 단순해 보이기 때문이다.
typescript/deep/type.1574483087.txt.gz · 마지막으로 수정됨: 2025/04/15 10:05 (바깥 편집)