목록Javascript (10)
undefined
1. for..of의 기본형식 for (변수지정 of iterable*) { } *iterable : 한 개의 데이터가 여러가지의 구성요소를 가지는 경우 참고) for loop의 기본 형식 for (let i = 0; i
// splice(start,deleteCount,elementIntoArray1....) const array = ["월", "화", "수", "목", "금", "토", "일"]; const weekend = array.splice(5, 2); // weekend = 토,일 / array = 월,화,수,목,금,토 array.splice(5,0,"토","일") // array = 월,화,수,목,금,토,일 // slice와는 다르게 대상 array가 업데이트된다. const array = [1,2,3,4,5] 1. slice의 경우 array.slice(1,4) // [2,3,4] array = [1,2,3,4,5] 2. splice의 경우 array.splice(1,3) // [2,3,4] array =..
'==' => type불문 동일시 true '===' => type까지 동일시 true ex) 1 == "1" //true 1 === "1" //false 0 == false //true 0 === false //false '!=' => type 불문 '!==' => type 동일 ex) 1 != "1" // false 1 !== "1" //true // !===는 존재X
// 매서드 thing.method(arg) argument = 인수 let msg = " Hello, World"; const whisper = message.toLowerCase().trim(); // indexOf() msg = "Hello, World"; msg.indexOf("Hello"); // 0 msg.indexOf("o"); // 4 //slice(beginIndex, endIndex) 하나일때와 beginIndex는 이상 // endIndex는 미만 msg = "Hello, World"; msg.slice(7); //Wolrd msg.slice(0, 5); // Hello msg.slice(-5); // World //replace(out,in) msg = "Hello, World"; ..