99. ETC
Tips
in ์ฐ์ฐ์
const trees = new Array('redwood', 'bay', 'cedar', 'oak', 'maple');
0 in trees; // ๋ฐฐ์ด์ 0๋ฒ์งธ ์ธ๋ฑ์ค๊ฐ ์กด์ฌํ๊ธฐ ๋๋ฌธ์ true๋ฅผ ๋ฐํํฉ๋๋ค.
6 in trees; // false๋ฅผ ๋ฐํํฉ๋๋ค.
'bay' in trees; // false๋ฅผ ๋ฐํํฉ๋๋ค. ๋ฐฐ์ด์ ๋ด์ฉ์ด ์๋, ์ธ๋ฑ์ค ๊ฐ์ ๋ช
์ํ์ฌ์ผ ํฉ๋๋ค.
'length' in trees; // true๋ฅผ ๋ฐํํฉ๋๋ค. length๋ Array(๋ฐฐ์ด) ๊ฐ์ฒด์ ์์ฑ์
๋๋ค.
// ๋ฏธ๋ฆฌ ์ ์๋ ๊ฐ์ฒด
'PI' in Math; // true๋ฅผ ๋ฐํํฉ๋๋ค.
'P' + 'I' in Math; // true๋ฅผ ๋ฐํํฉ๋๋ค.include
๊ตฌ๋ฌธ
Last updated