How to run javascript and sublimejavascript in sublime text
In Console mode, the browser can not only edit but also run js.
In most scenarios, we edit and save the content in IDE, and then open the preview in the browser.
In the field of web Front-end, sublime text has become my favorite in javascript editing. It has always been repeated in the past.
Today, I learned how to edit and run javascript in sublime text.
Preparation materials:
1: first install sublime. I chose version 2. After all, I am familiar with the syntax starting with python2. I can modify and try to develop some plug-ins. The sublime3 plug-in is developed under python3.
2: Install nodejs (the last article forced nodejs installation)
Start setting:
Get File
Edit: note that nodejs has been installed in the/usr/local/bin/folder.
Then save
At this time, you can view the paths to which our files have been added and added through the terminal.
Then we write a program to break down integers in a form.
Concepts:
Prime Number: A natural number greater than 1. Apart from 1 and itself, it cannot be divisible by other natural numbers (prime numbers ).
Factorization: Splits a number into the product of several prime numbers.
Ideas:
To break down an integer into all its prime factor
First, find a number, which can be divided into the integer division of the formula.
Second, if this number is a prime number, save this number.
Third, continue decomposition by the quotient obtained by the prime factor
Code Implementation
Save it anywhere and set the current compiling environment to nodejs
The last step is to press the shortcut key command + B to run the program.
End!
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.