How to run javascript and sublimejavascript in sublime text

Source: Internet
Author: User
Tags integer division

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.