In the JavaScript elementary tutorial (Lesson 2), we learned where JavaScript appears and what it looks like. Now let's start learning this language. In this lesson, we will learn how to store information in JavaScript, how to make decisions based on information, and how to alternate images based on user interaction requirements.
Are you ready? Now I want to learn the basics of computer programming. First, variables.
If you have learned algebra, you must have seen variables. It doesn't matter if you have never learned it. Variables are a simple way for JavaScript to store information. For example, if you write: "x = 2," "x" is a variable and its storage value is 2. If you say "y = x + 3,", "y" will have a value of "5"
Here is a JavaScript example using variables.
In this example, you can view the source code step by step:
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.