
trim() | trimStart() | trimEnd() 02. ๋ฌธ์์ด : toUpperCase() | toLowerCase() ๋ฌธ์์ด ์/๋ค ๊ณต๋ฐฑ์ ์ ๊ฑฐํฉ๋๋ค. ๋ฒํธ ๊ธฐ๋ณธ๊ฐ ๋ฉ์๋ ๋ฆฌํด๊ฐ const str1 = " javascript "; const currentStr1 = str1.trim(); document.querySelector(".sample03_N1").innerHTML = "1"; document.querySelector(".sample03_Q1").innerHTML = " javascript "; document.querySelector(".sample03_M1").innerHTML = "trim()"; document.querySelector(".sample03_P1").innerH..

๋ฌธ์์ด: ๋ฌธ์์ด ๊ฒฐํฉ / ํ ํ๋ฆฟ ๋ฌธ์์ด 02. ๋ฌธ์์ด : toUpperCase() | toLowerCase() toUpperCase() : ๋ฌธ์์ด์ ๋๋ฌธ์๋ก ๋ณ๊ฒฝํ๊ณ , toLowerCase() : ๋ฌธ์์ด์ ์๋ฌธ์๋ก ๋ณ๊ฒฝํฉ๋๋ค. ๋ฒํธ ๊ธฐ๋ณธ๊ฐ ๋ฉ์๋ ๋ฆฌํด๊ฐ const str1 = "javascript"; const currentStr1 = str1.toUpperCase(); document.querySelector(".sample02_N1").innerHTML = "1"; document.querySelector(".sample02_Q1").innerHTML = "javascript"; document.querySelector(".sample02_M1").innerHTML = "toUpperCase()"; ..

๋ฌธ์์ด: ๋ฌธ์์ด ๊ฒฐํฉ / ํ ํ๋ฆฟ ๋ฌธ์์ด 01. ๋ฌธ์์ด : ๋ฌธ์์ด ๊ฒฐํฉ / ํ ํ๋ฆฟ ๋ฌธ์์ด ์ผ๋ฐ์ ์ผ๋ก, ์๋ฐ์คํฌ๋ฆฝํธ์์ "+" ์ฐ์ฐ์๋ฅผ ์ฌ์ฉํ์ฌ ๋ฌธ์์ด์ ํฉ์น๋ค. ํ ํ๋ฆฟ ๋ฌธ์์ด์ ๋ด์ฅ๋ ํํ์์ ํ์ฉํ๋ ๋ฌธ์์ด ๋ฆฌํฐ๋ด(`$`)์ด๋ค. ๋ฒํธ ๊ธฐ๋ณธ๊ฐ ๋ฉ์๋ ๋ฆฌํด๊ฐ //01 const str1 = "์๋ฐ์คํฌ๋ฆฝํธ"; const str2 = "์ ์ด์ฟผ๋ฆฌ"; document.querySelector(".sample01_N1").innerHTML = "1"; document.querySelector(".sample01_Q1").innerHTML = "์๋ฐ์คํฌ๋ฆฝํธ, ์ ์ด์ฟผ๋ฆฌ"; document.querySelector(".sample01_M1").innerHTML = "๋ฌธ์์ด(string) ๊ฒฐํฉ"; document.query..

์ ๊ทํํ์(Regex)์ด๋? ์ ๊ท ํํ์, ๋๋ ์ ๊ท์์ ๋ฌธ์์ด์์ ํน์ ๋ฌธ์ ์กฐํฉ์ ์ฐพ๊ธฐ ์ํ ํจํด์ ๋๋ค. ์ ๊ทํํ์ ๊ฐ์ฒด ์ฃผ์ ํจํด ํจํด ์ค๋ช abc abc ๋ฌธ์์ด์ ๊ฒ์ํฉ๋๋ค. /abc/๋ 'abc' [abc] abc ์ค ๋ฌธ์ ํ๋๋ฅผ ๊ฒ์ํฉ๋๋ค. /[abc]d/๋ 'ad', 'bd', 'cd' [^abc] abc๋ฅผ ์ ์ธํ ๋ฌธ์ ํ๋๋ฅผ ๊ฒ์ํฉ๋๋ค. /[^abc]/๋ 'ed', 'fd', 'gd' [A-Z] ์ํ๋ฒณ ๋๋ฌธ์ ๋ฌธ์๋ฅผ ๊ฒ์ํฉ๋๋ค. . ํ๋์ ๋ฌธ์๋ฅผ ๊ฒ์ํฉ๋๋ค. ๋ง์ฝ '๋ง์นจํ'๋ฌธ์ ๊ทธ๋๋ก์ ์๋ฏธ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ '\.'์ผ๋ก ํํํด์ผ ํฉ๋๋ค. \w ์ํ๋ฒณ, ์ซ์, _๋ฅผ ๊ฒ์ํฉ๋๋ค. \W ์ํ๋ฒณ, ์ซ์, _๋ฅผ ์ ์ธํ๊ณ ๊ฒ์ํฉ๋๋ค. \d ์ซ์๋ฅผ ๊ฒ์ํฉ๋๋ค \D ์ซ์๋ฅผ ์ ์ธํ๊ณ ๊ฒ์ํฉ๋๋ค [0-9] 0..

slice() | substring() | substr() ๋ฉ์๋ slice() slice() ๋ฉ์๋๋ ๋ฌธ์์ด์์ ์ํ๋ ๊ฐ์ ์ถ์ถํ์ฌ ์๋ก์ด ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. //slice(์์์์น, ๋๋๋ ์์น) //์์์์น < ๋๋๋ ์์น const str1 = "javascript reference"; const currentStr1 = str1.slice(0); //javascript reference const currentStr2 = str1.slice(1); //avascript reference const currentStr3 = str1.slice(2); //vascript reference const currentStr4 = str1.slice(0,1); //j const currentStr5 =..

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..

ํด์ฆ ์ดํํธ 05 ์น๋์์ธ๊ธฐ๋ฅ์ฌ ํ๊ธฐ ํด์ฆ - JS๋ฅผ ํตํด ์ฌ๋ฌ ๋ฌธ์ ์ ์ ๋ต์ ๊ฐ๊ด์์ผ๋ก ์ ํํ ์ ์๊ณ , ์ ๋ ฅ ํ ์ ๋ต/์ค๋ต/ํด์ค๋ก ์๋ ค์ค๋๋ค. ๊ฒฐ๊ณผ ์๋ณธ ์์ค ๋ณด๊ธฐ JavaScript for๋ฌธ๊ณผ if๋ฌธ์ ํตํด ๊ฐ๊ด์ ๋ณด๊ธฐ ๋ฌธ์ ๋ฅผ ์ถ๋ ฅํ๊ณ ์ ๋ต/์ค๋ต์ ๋น๊ตํ ์ ์๋ค. //๋ฌธ์ ์ ๋ณด const quizInfo = [ { answerType: "์น๋์์ธ๊ธฐ๋ฅ์ฌ 2012๋ 02ํ", answerNum: "1.", answerAsk: "์ ์ฒด์ ๋ํ ์ค๋ช ์ผ๋ก ์ณ์ง ์์ ๊ฒ์?", answerChoice: { 1: "์๊ทน์ ์ ์ฒด๋ ํ์ค์ ํ, ํ์คํ ์ง๊ฐ๋๋ ํ์ ๋งํ๋ค", 2: "์ ์ฒด๋ ๋ฉด์ด ์ด๋ํ ์์ทจ์ด๋ค", 3: "๋ ๋ฉด๊ณผ ๊ฐ๋๋ฅผ ๊ฐ์ง ๋ฐฉํฅ์ผ๋ก ์ด๋ํ๊ฑฐ๋ ๋ฉด์ ํ์ ์ ์ํด ์๊ธด๋ค", 4: "์์ํ ์ ์ฒด๋ ๊ตฌ,..

๊ตฌ์กฐ ๊ด๋ จ ์์ ๋ฐ์ํ์น MENU01 MENU02 MENU03 MENU04 MENU05 ์ฝํ ์ธ ๊ทธ๋ฃน01 ์ฝํ ์ธ ๊ทธ๋ฃน02 ์ฃผ์ ๊ธฐ์ฌ ๊ด๊ณ ๊ฒฝ๊ธฐ๋ ๋ถ์ฒ์ ์ค์ ๊ตฌ ์ผ์ ๋ 032)674-5685 icoxpub@naver.com COPYRIGHT @ All right reserved. CSS @import url('https://fonts.googleapis.com/css2?family=Gothic+A1&display=swap'); * { margin: 0; padding: 0; font-family: 'Gothic A1', sans-serif; font-weight: 100; font-size: 14px; } a { text-decoration: none; color: black; } header { backg..

๋ด์ฅ ํจ์(Built-in Functions) ๋ด์ฅ ํจ์๋ js์ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ด์ฅ๋์ด ์๋ ํจ์๋ค์ ๋งํฉ๋๋ค. ์ธ์ฝ๋ฉ, ๋์ฝ๋ฉ ํจ์ URL์ฃผ์์ ์ฟผ๋ฆฌ ์ ๋ณด๋ฅผ ์ ์กํ์ฌ ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํด์ผ๋๋ ํ๋ก๊ทธ๋จ์ ๊ฒฝ์ฐ ํ๊ธ๊ณผ ๊ฐ์ ์ ๋์ฝ๋ ๋ฌธ์๊ฐ ํฌํจ๋์ด ์์ผ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค. ์ด๋ฐ ๊ฒฝ์ฐ ์ธ์ฝ๋ฉ ํจ์๋ฅผ ์ด์ฉํ์ฌ ๋ฌธ์๋ฅผ ๋ถํธํ์ํค๊ณ , ๋ถํธํ๋ ๋ฌธ์๋ฅผ ๋ค์ ๋์ฝ๋ฉ ํจ์๋ฅผ ์ด์ฉํ์ฌ ์๋ ๋ฌธ์๋ก ๋๋๋ฆด ์ ์์ต๋๋ค. ํจ์๋ช ์ค๋ช encodeURIComponent() ์๋ฌธ, ์ซ์์ () - _ . ~ * ! ' ์ ์ ์ธํ ๋ฌธ์๋ฅผ ์ธ์ฝ๋ฉํฉ๋๋ค. decodeURIComponent() encodeURIComponent()์ ๋์ฝ๋ฉ ํจ์ ์ซ์, ์ /๋ฌดํ ๊ฐ ํ๋ณ ํจ์ ์คํ์ผ ์์ฑ์ ๋ฐ๋ก *.css ํ์ฅ์๋ฅผ ๊ฐ์ง ํ์ผ๋ก ์ ..