
indexOf() | lastIndexOf() indexOf() | lastIndexOf() indexOf() 메서드는 배열에서 지정된 요소를 찾을 수 있는 첫 번째 인덱스를 반환하고 존재하지 않으면 -1을 반환합니다. "문자열".indexOf(검색값) "문자열".indexOf(검색값, 위치값) const str1 = "456"; const currentStr1 = str1.padStart(1, "0"); //456 const currentStr2 = str1.padStart(2, "0"); //456 const currentStr3 = str1.padStart(3, "0"); //456 const currentStr4 = str1.padStart(4, "0"); //0456 const currentSt..
Javascript
2022. 8. 16. 16:11
공지사항