typescript16 [ 타입스크립트(TypeScript) ] interface 사용하지 않고 써보기 사용하고 써보기 📍 interface 사용하지 않고 써보기 사용하고 써보기 // do not use Interface const getMathScore = (scoreObj: {math: number}): number => { return scoreObj.math } const myScore = {korean: 85, math: 95, english: 87} const myMathScore = getMathScore(myScore); console.log(myMathScore) 👉🏽 95 // do Interface interface PhysicalValue { physical: number; } const getPhysicalScore = (scoreObj: PhysicalValue) => { return scoreO.. 2021. 7. 7. 이전 1 2 3 4 다음