
charAt() charAt ๋ฉ์๋๋ ๋ฌธ์์ด์์ ํน์ ์ธ๋ฑ์ค์ ์์นํ๋ ์ ๋์ฝ๋ ๋จ์ผ๋ฌธ์๋ฅผ ๋ฐํํฉ๋๋ค. charAt() //"๋ฌธ์์ด".charAt(์ซ์); const str1 = "javascript reference"; const currentStr1 = str1.charAt() //j const currentStr2 = str1.charAt("0") //j const currentStr3 = str1.charAt("1") //a const currentStr4 = str1.charAt("2") //v

match() match() ๋ฉ์๋๋ ๋ฌธ์์ด์ด ์ ๊ท์๊ณผ ๋งค์น๋๋ ๋ถ๋ถ์ ๊ฒ์ํฉ๋๋ค. match() //"๋ฌธ์์ด".match(๊ฒ์๊ฐ) const str1 = "javascript reference"; const currentStr1 = str1.match("javascript") //[javascript] const currentStr2 = str1.match("reference") //[reference] const currentStr3 = str1.match("r") //[r] const currentStr4 = str1.match(/reference/) //[reference] const currentStr5 = str1.match(/Reference/) //null const currentStr6 ..

search() search() search ๋ฉ์๋๋ ๋ฌธ์์ด(์ ๊ท์)์ ๊ฒ์ํ๊ณ ์์น๊ฐ(์ซ์)๋ฅผ ๋ฐํํฉ๋๋ค. //"๋ฌธ์์ด".search(๊ฒ์๊ฐ) //"๋ฌธ์์ด".search(์ ๊ท์ ํํ) const str1 = "javascript reference"; const currentStr1 = str1.search("javascript"); //0 const currentStr2 = str1.search("reference"); //11 const currentStr3 = str1.search("j"); //0 const currentStr4 = str1.search("a"); //1 const currentStr5 = str1.search("v"); //2 const currentStr6 = str1.sear..

search() search() search ๋ฉ์๋๋ ๋ฌธ์์ด(์ ๊ท์)์ ๊ฒ์ํ๊ณ ์์น๊ฐ(์ซ์)๋ฅผ ๋ฐํํฉ๋๋ค. //"๋ฌธ์์ด".search(๊ฒ์๊ฐ) //"๋ฌธ์์ด".search(์ ๊ท์ ํํ) const str1 = "javascript reference"; const currentStr1 = str1.search("javascript"); //0 const currentStr2 = str1.search("reference"); //11 const currentStr3 = str1.search("j"); //0 const currentStr4 = str1.search("a"); //1 const currentStr5 = str1.search("v"); //2 const currentStr6 = str1.sear..

ํจ์ ์ ํ (Function Type) ํจ์๋ ํ๋ก๊ทธ๋จ์์ ๋ฐ๋ณต์ ์ผ๋ก ์ฌ์ฉ๋๋ ๊ธฐ๋ฅ์ ๋ง๋ค์ด ๋ด๊ธฐ ์ํ ์ฝ๋๋ค์ ์งํฉ 1. ํจ์ ์ ํ : ํจ์์ ๋งค๊ฐ๋ณ์๋ฅผ ์ด์ฉํ ํํ ์ฝ๋๋ฅผ ์ฌํ์ฉํ๊ธฐ ์ํด ํจ์๋ฅผ ์ฌ์ฉํ๋ค. function func(num, str1, str2){ document.write(num+ ". " + str1 + "๊ฐ" + str2 + "๋์์ต๋๋ค. " + " ") } func("1","ํจ์", "์คํ") //1. ํจ์๊ฐ ์คํ๋์์ต๋๋ค. func("2","์๋ฐ์คํฌ๋ฆฝํธ", "์คํ") //2. ์๋ฐ์คํฌ๋ฆฝํธ๊ฐ ์คํ๋์์ต๋๋ค. func("3","์ ์ด์ฟผ๋ฆฌ", "์คํ") //3. ์ ์ด์ฟผ๋ฆฌ๊ฐ ์คํ๋์์ต๋๋ค. 2. ํจ์ ์ ํ : ํจ์์ ๋ณ์๋ฅผ ์ด์ฉํ ํํ function func(num, str1, str..

includes() includes() includes ๋ฉ์๋๋ ๋ฌธ์์ด ํฌํจ ์ฌ๋ถ๋ฅผ ๊ฒ์ํ๋ฉฐ, ๋ถ๋ฆฐ(true, false)์ ๋ฐํํฉ๋๋ค. //"๋ฌธ์์ด".includes(๊ฒ์๊ฐ) //"๋ฌธ์์ด".includes(๊ฒ์๊ฐ, ์์๊ฐ) const str1 = "javascript reference"; const currentStr1 = str1.includes("javascript"); //true const currentStr2 = str1.includes("j"); //true const currentStr3 = str1.includes("b"); //false const currentStr4 = str1.includes("reference"); //true const currentStr5 = str1.incl..

padStart() | padEnd() padStart() | padEnd() padStart / padEnd ๋ฉ์๋๋ ์ฃผ์ด์ง ๊ธธ์ด์ ๋ง๊ฒ ์/๋ค ๋ฌธ์์ด์ ์ฑ์ฐ๊ณ , ์๋ก์ด ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. //"๋ฌธ์์ด".padStart(๊ธธ์ด) //"๋ฌธ์์ด".padStart(๊ธธ์ด, ๋ฌธ์์ด) 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 currentStr5 = str1.p..

repeat() repeat() repeat ๋ฉ์๋๋ ๋ฌธ์์ด์ ๋ณต์ฌํ์ฌ, ๋ณต์ฌํ ์๋ก์ด ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. const str1 = "javascript"; const currentStr1 = str1.repeat(0); // '' const currentStr2 = str1.repeat(1); // javascript const currentStr3 = str1.repeat(2); // javascriptjavascript console.log(currentStr3);

concat() concat() concat ๋ฉ์๋๋ ๋ ๊ฐ์ ๋ฌธ์์ด์ ํ๋์ ๋ฌธ์์ด๋ก ๋ง๋ค์ด์ฃผ๋ ์ญํ์ ํ๋ ํจ์์ด๋ฉฐ, ์ ๋ ฅ๊ฐ์ ๋ฌธ์์ด ๋์ ๋ฐฐ์ด์ ์ฌ์ฉํ๋ฉด ๋ ๊ฐ์ ๋ฐฐ์ด์ ํ๋์ ๋ฐฐ์ด๋ก ๋ง๋ค์ด์ฃผ๋ ์ญํ๋ ํ๋ ํจ์์ ๋๋ค. >const str1 = "javascript"; const currentStr1 = str1.concat("reference"); //javascriptreference const currentStr2 = str1.concat(" ","reference"); //javascript reference const currentStr3 = str1.concat(",","reference"); //javascript,reference const currentStr4 = str1.conca..

replace() | replaceAll() replace() | replaceAll() replace() ๋ฉ์๋๋ ์ด๋ค ํจํด์ ์ผ์นํ๋ ์ผ๋ถ ๋๋ ๋ชจ๋ ๋ถ๋ถ์ด ๊ต์ฒด๋ ์๋ก์ด ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. replaceAll์ ์ฒซ๋ฒ์งธ ์ธ์๊ฐ์ ์ ๊ท์์ด ๋ค์ด๊ฐ๋๋ค. //"๋ฌธ์์ด".replace("์ฐพ์ ๋ฌธ์์ด", "๋ณ๊ฒฝํ ๋ฌธ์์ด") //"๋ฌธ์์ด".replace(์ ๊ท์) //"๋ฌธ์์ด".replace(์ ๊ท์, ๋ณ๊ฒฝํ ๋ฌธ์์ด) const str1 = "javascript reference"; const currentStr1 = str1.replace("javascript", "์๋ฐ์คํฌ๋ฆฝํธ"); //์๋ฐ์คํฌ๋ฆฝํธ reference const currentStr2 = str1.replace("j", "J"); //Javascr..