HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧐
Sonny
/
😧
typeof를 사용하면 Uncaught SyntaxError가 나지 않는다!?
😧

typeof를 사용하면 Uncaught SyntaxError가 나지 않는다!?

날짜
Jun 30, 2022
오늘 js에서 새롭게 알게된 사실!!
// Uncaught SyntaxError: Unexpected identifier cosnt a = true if ( a && b ) { console.log('에러가 발생합니다') }
// ... const a = true if (a && typeof b === 'string') { console.log('에러가 발생하지 않습니다') }
  • 앞에 typeof만 붙였을 뿐인데 에러가 발생하지 않는 상황..!! 너무 신기했다…