๐ŸŒˆ ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] ํŠน์ˆ˜๋ฌธ์ž ์ถœ๋ ฅํ•˜๊ธฐ

Eun_zii 2024. 4. 15. 16:26

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0

- ํŠน์ˆ˜๋ฌธ์ž ์ถœ๋ ฅํ•˜๊ธฐ

 

๐Ÿ’š ๋ฌธ์ œ์„ค๋ช…

 

๐Ÿ’š ์ œํ•œ์กฐ๊ฑด

  •  

๐Ÿ’š ํ’€์ด

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on('close', function () {
    const str = `!@#$%^&*(\\'"<>?:;`
    console.log(str)
});

 

โœ… 

์ฒ˜์Œ์—๋Š” 

console.log("!@#$%^&*(\'"<>?:;")

console.log(!@#$%^&*(\'"<>?:;)

๋ผ๊ณ  ํ–ˆ๋‹ค๊ฐ€ ๊ณ„์† ์‹คํŒจํ•ด์„œ 

console.log(`!@#$%^&*(\'"<>?:;`)
// 	!@#$%^&*('"<>?:;

๋ฐฑํ‹ฑ( ` ` ) ์œผ๋กœ ํ•ด๋ดค๋”๋‹ˆ ์—๋Ÿฌ์—†์ด ์ถœ๋ ฅ์€ ๋˜๋Š”๋ฐ ์‹คํŒจํ•˜์˜€๋‹ค. ๊ฑฐ๊ธฐ๋‹ค \ ( ๋ฐฑ์Šฌ๋ž˜์‹œ )๊ฐ€ ๋ˆ„๋ฝ๋˜์–ด์žˆ์–ด์„œ ๊ฒ€์ƒ‰ํ•ด๋ณด์•˜๋‹น !

 

๋ฌธ์ž์—ด ๋‚ด ํŠน์ˆ˜๋ฌธ์ž๊ฐ€ ์ž‘์„ฑ๋  ๊ฒฝ์šฐ ํŠน์ˆ˜๋ฌธ์ž ํ‘œ๊ธฐ ๋ฐฉ๋ฒ• ์ค‘ escape ๋ฌธ์ž๋ผ๋Š”๊ฒŒ ์žˆ์—ˆ๋‹ค.

๋ฌธ์ž์—ด๋‚ด์—์„œ ์ž‘์€ ๋”ฐ์˜ดํ‘œ( ' ' )์™€ ํฐ๋”ฐ์˜ดํ‘œ( " " )๋ฅผ ๊ฐ™์ด ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์„๋•Œ ๋ฐฑ์Šฌ๋ž˜์‹œ ( \ )๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด๋˜๋Š”๊ฑฐ์˜€๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๋ฌธ์ž์—ด๋‚ด์—์„œ ๋ฐฑ์Šฌ๋ž˜์‹œ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์œผ๋ฉด ๋‘๋ฒˆ ์‚ฌ์šฉํ•˜๋ฉด๋œ๋‹ค.
 

 

โค๏ธ ๋„์›€์ฃผ์‹ ๋ถ„ :

728x90