.at()
at()은 정수를 받고, 정수의 인덱스 값을 반환한다. String.at()const sentence = 'The quick brown fox jumps over the lazy dog.';let index = 5;console.log(`An index of ${index} returns the character ${sentence.at(index)}`);// "An index of 5 returns the character u"index = -4;console.log(`An index of ${index} returns the character ${sentence.at(index)}`);// "An index of -4 returns the character d"Array.at()const array1..
JavaScript
2024. 6. 18. 20:14