@ reverse - ๋ฐฐ์ด.reverse() : ๋ฐฐ์ด ๋ค์ง๊ธฐ
var test = [1,2,3,4,5];
test.reverse(); //test=[5,4,3,2,1]
@ split - ๋ฌธ์.split("๋๋๋ฌธ์์ด") : ๋ฌธ์์ด ๋ฐฐ์ดํ ํ๊ธฐ
var testString = "1,2,3,4,5";
testString.split(",");// ["1", "2", "3", "4", "5"]
@ shift - ๋ฐฐ์ด.shift("๋ฌธ์") : ๋ฐฐ์ด ์ฒซ๋ฒ์งธ ๊ฐ ๋นผ๊ธฐ([๋ฐฉํฅ:<--]์ผ์ชฝ์ผ๋ก ๋ฐ๋ ค์ง)
var test = [1,2,3,4,5];
test.shift();//1
test.shift();//2
test.shift();//3
test.shift();//4
test.shift();//5
test.shift();//undefined
console.log(test);//
var testA = [6,7,8,9];
testA.shift();//6
console.log(testA);//(3) [7, 8, 9]
@ unshift - ๋ฐฐ์ด.unshift("๋ฌธ์") : ๋ฐฐ์ด๊ฐ ์ฒซ๋ฒ์งธ์ ๊ฐ ์ถ๊ฐ([๋ฐฉํฅ:-->]์ค๋ฅธ์ชฝ์ผ๋ก ๋ฐ๋ ค์ง)
var test = [1,2,3]
test.unshift()
console.log(test);// (3) [1, 2, 3]
test.unshift(4)
console.log(test); // (4) [4, 1, 2, 3]
test.unshift(6)
console.log(test);// (5) [6, 4, 1, 2, 3]
@ push - ๋ฐฐ์ด.push(๋ฃ๋๊ฐ) : ๋ฐฐ์ด๊ฐ ๋์์์ ๊ฐ ์ถ๊ฐ
var test = [1,2,3,4,5,6];
test.push(7); //7
console.log(test); // (7) [1, 2, 3, 4, 5, 6, 7]
@ pop - ๋ฐฐ์ด.pop() : ๋ฐฐ์ด๋ค์ ๋ฐฐ์ด๊ฐ ๋นผ๊ธฐ
var test = [1,2,3,4,5,6];
test.push(); //6
console.log(test); // (5) [1, 2, 3, 4, 5]
@ splice - ๋ฐฐ์ด.splice(์์,๊ฐฏ์) : ์์์์น๋ถํฐ ๊ฐฏ์๊น์ง ๋ฒ๋ฆผ
var test = [1,2,3,4,5,6,7,8,9];
test.splice(0,2)// (2) [1, 2] : 0๋ฒ์งธ์์ 2๊ฐ ๋ฒ๋ฆผ
console.log(test)// (7) [3, 4, 5, 6, 7, 8, 9]
test.splice(2,5)// (5) [5, 6, 7, 8, 9] : 012๋ฒ์งธ์์5๊ฐ๋ฒ๋ฆผ
console.log(test)// (2) [3, 4]
@ concat - A๋ฐฐ์ด.concat(B๋ฐฐ์ด) : ๋ฐฐ์ดํฉ์น๊ธฐ(A+B)
var A = [5,6,7]
var B = [1,2,3]
A.concat(B) //(6) [5, 6, 7, 1, 2, 3]
@ join - ๋ฐฐ์ด.join("๋ฌถ๋๋ฌธ์์ด") : ๋ฐฐ์ด์ ๋ฌถ๋๋ฌธ์์ด๋ก ์ฐ๊ฒฐํ์ฌ ๋ฌธ์์ด๋ก ๋ณ๊ฒฝ
var test = [1,2,3,4,555,6]
test.join(",") //"1,2,3,4,555,6"
test.join("555")//"15552555355545555555556"
test.join("1")//"1121314155516"
test.join("-")//"1-2-3-4-555-6"
@ sort - ๋ฐฐ์ด.sort() : ๋ฐฐ์ด ์ ๋ ฌ
var test = [4,3,6,1,2]
test.sort() //(5) [1, 2, 3, 4, 6]
@ substr - ๋ฌธ์.substr(์์,๊ฐฏ์) : ์์๋ถํฐ ๊ฐฏ์๊น์ง ์ถ์ถ
var test = 'Hello, my world!!';
test.substr(2,3) //"llo"//012๋ฒ์งธ์์3๊ฐ
test.substr(0,3)//"Hel"//0๋ฒ์งธ์์3๊ฐ
test.substr(0,5) //"Hello" //0๋ฒ์งธ์์5๊ฐ
test.substr(5,5)//", my " //012345๋ฒ์งธ์์ 5๊ฐ