๋ชฉ๋กad ์ œ๊ฑฐํ•˜๊ธฐ (1)

๐Ÿค ์€์ง€log ๐Ÿค

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] ad ์ œ๊ฑฐํ•˜๊ธฐ

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0 - ad ์ œ๊ฑฐํ•˜๊ธฐ ๐Ÿ’š ๋ฌธ์ œ์„ค๋ช… ๋ฌธ์ž์—ด ๋ฐฐ์—ด strArr๊ฐ€ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. ๋ฐฐ์—ด ๋‚ด์˜ ๋ฌธ์ž์—ด ์ค‘ "ad"๋ผ๋Š” ๋ถ€๋ถ„ ๋ฌธ์ž์—ด์„ ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ๋ชจ๋“  ๋ฌธ์ž์—ด์„ ์ œ๊ฑฐํ•˜๊ณ  ๋‚จ์€ ๋ฌธ์ž์—ด์„ ์ˆœ์„œ๋ฅผ ์œ ์ง€ํ•˜์—ฌ ๋ฐฐ์—ด๋กœ return ํ•˜๋Š” solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด ์ฃผ์„ธ์š”. ๐Ÿ’š ์ œํ•œ์กฐ๊ฑด 1 ≤ strArr์˜ ๊ธธ์ด ≤ 1,000 1 ≤ strArr์˜ ์›์†Œ์˜ ๊ธธ์ด ≤ 20 strArr์˜ ์›์†Œ๋Š” ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ๐Ÿ’š ํ’€์ด function solution(strArr) { return strArr.filter(n => !n.includes("ad")) } โœ… ๋ฐฐ์—ด์—์„œ "ad"๊ฐ€ ํฌํ•จ๋œ ๋ฌธ์ž์—ด์„ ๋นผ์ค˜์•ผ ํ•˜๋ฏ€๋กœ filter( ) ๋ฉ”์„œ๋“œ( ์ฃผ์–ด์ง„ ํ•จ์ˆ˜๋ฅผ ํ†ต๊ณผํ•˜๋Š” ๋ชจ๋“  ์š”์†Œ๋ฅผ ํฌํ•จํ•˜๋Š” ์ƒˆ๋กœ์šด ๋ฐฐ์—ด์„ ..