Using sublime with node. js to write JS code is particularly cool, specific online tutorials. See: http://blog.csdn.net/dududu01/article/details/42804367, the most important of which is the
Menu Tools--build system--New build system ...
The Chinese version of the word is the tools--- compile system--new build system ...
Write some code to implement code debugging directly with sublime, the code is as follows:
{ "cmd": ["Node", "$file"], "File_regex": "^[]*file \" (... *) \ ", line ([0-9]*)", "Working_dir": "${project_path:${folder}", " selector": "Source.js", "shell": true, "encoding": "Utf-8", "Windows": { "cmd": ["taskkill/f/im node.exe >nul 2>nul & Node", "$file"]
}, "Linux": { "cmd": ["Killall node; Node "," $file "] }}
Then press CTRL+B can directly run the JS code, without the need to put JS in conjunction with HTML debugging run.
Today again review the next JS callback function, the specific code is as follows:
function W (callback2,sth) {sth + = ' very cool '; Callback2 (STH);} W (function (sth) {console.log (STH);}, ' W ye ')
In fact, it is very simple, running results such as:
JS callback function 2