본 자료는 박규하 코치님과 Elice 플랫폼의 자료를 사용하여 정리하였습니다.
let numbers = [0, 1, 2];
console.log(numbers[1]); // 1
let name = "kim";
let sentence = "Hello, world!";
console.log(name[0]); // "k"
console.log(sentence[7]); // "w"
let number = [0, 1, 2, 3];
let numberToString = numbers.toString();
console.log(numberToString); // "0, 1, 2, 3"
let sentence = "Hello, world!";
let words = sentence.split(" ");
console.log(words); // ["Hello,", "world!"]
fruit.length;
fruit.push("딸기“);
fruit.unshift("레몬”);
fruit.pop();
fruit.shift();
fruit.concat(morefruit);
fruit.sort();
a-b
가 필요fruit.indexOf("cherry");
str.length;
str.charAt(0);
str.split(" ");
str.toUpperCase();
str.toLowerCase();
str.trim();
str.replace("Kim", "Lee");
replace
는 먼저 나온 하나만 교체한다.replaceAll
을 사용한다.Math.abs(-3);
Math.ceil(0.3);
Math.floor(10.9);
Math.random();
parseInt("20.6");
// 20parseFloot("20.6");
// 20.6