In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to run javascript in Sublime Text, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Running javascript (ES6) in Sublime Text first installs nodejs
Of course, you can use other environments such as jsc to run js, this article uses nodejs. First of all, make sure that your computer has installed nodejs and added it to the environment variable (usually add it automatically or ask if you want to add it)
Add build system
Open Tools-> Build System-> New Build System... in sublime text Paste the following code and save it (such as Node.sublime-build), and then set Build System to Automatic
{"cmd": ["node", "--use-strict", "--harmony", "$file"], "selector": "source.js"} description
In the above build file (Node.sublime-build), node is the execution command,-- harmony and-- use-strict are execution parameters, and $file is the current file name, so a build operation is actually equivalent to executing node-- use-strict-- harmony filename on the command line. -- harmony means that ES Harmony features is enabled, and these features can only be run in strict mode, so you need to add use-strict parameters at the same time (see what-is-extended-mode for details).
If you do not want to enable es6 features, change the build file to the following code to save.
{"cmd": ["node", "$file"], "selector": "source.js"} use
Create a new test.js file in sublime test and enter your test code, such as:
For (let I = 0; I < 3; iTunes +) {console.log (I);}
Using the shortcut key ctrl + b, you will get the following execution result:
I: 0i: 1i: 2 [Finished in 0.1s]
Note: the file must exist on disk, not untitled, otherwise sublime cannot find the corresponding file.
The above is all the contents of the article "how to run javascript in Sublime Text". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.