nodejs

typescript 꿀팁

펀치맨 2022. 3. 3. 19:06

🎈 value check

🎵 check if value in enum

🎵 check if value in json object

findValue in enumOrJsonValue

 

🎵 find in json array

values.find((e) => e.no == wnatNo );

 

🎵 check if object is empty

 Object.keys(value).length === 0

 

🎈 loop

🎵 for ... of with index

const array1 = ['a', 'b', 'c'];

for (const [i, v] of array1.entries()) {

}

 

🎇 online editor

https://www.typescriptlang.org/play

반응형