多行 JavaScript

Snook.ca看到的,在寫JavaScript的時候,脫逸字元「\」也可以用來讓程式碼換行:

var a = 'You can start here \
and continue here \
and then finish it up here.';

— I can’t believe I didn’t know that. 筆記…

可能的相關文章:

 
 
 

歡迎留言: