ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 语句 [toc] ## 条件语句 - if...else... - switch ## 循环语句 - while - do...while... - for - for...in... - break,continue(break跳出循环,continue跳过本次循环) ## with语句 把作用域指向特定对象 ``` javascript var kitty = { age:3, friend:{ name:'snoopy', age:2 } } with(kitty.friend){ document.write(name + '\'s age is' + age); } ``` ## 异常捕获语句 ``` javascript try{ document.write(notDefined); }catch(error){ console.log(error); alert(error); }finally{ alert('finally'); } ```