我想检查变量是否已定义.例如,以下引发了未定义的错误
alert( x );
我怎么能抓到这个错误?
javascript variables undefined
javascript ×1
undefined ×1
variables ×1