MDN’s new design is in Beta! A sneak peek:

JavaScript 第一步

翻譯不完整。請協助 翻譯此英文文件

在我們第一個JavaScript模組,在帶領各位開始體驗撰寫JavaScript前,我們首先回答一些基本的問題,像是"什麼是JavaScript?" "它看起來像什麼?",以及"它可以做什麼?"。之後,我們會詳細討論一些建立這些區塊的重要關鍵,像是變數、字串、數字、陣列。


在開始這個模組前,你不需要具備任何JavaScript知識,但是你必需要熟悉HTML以及CSS,我們建議您在開始學習JavaScript前,先下看過列模組的內容 :

注意: 假如你正在進行 computer/tablet/other device,你不需要建立自己的檔案,你可以嘗試線上程式撰寫系統來撰寫範例程式,像是 JSBin 或 Thimble.


What is JavaScript?
Welcome to the MDN beginner's JavaScript course! In this first article we will look at JavaScript from a high level, answering questions such as "what is it?", and "what is it doing?", and making sure you are comfortable with JavaScript's purpose.
A first splash into JavaScript
Now you've learned something about the theory of JavaScript, and what you can do with it, we are going to give you a crash course in the basic features of JavaScript via a completely practical tutorial. Here you'll build up a simple "Guess the number" game, step by step.
What went wrong? Troubleshooting JavaScript
When you built up the "Guess the number" game in the previous article, you may have found that it didn't work. Never fear — this article aims to save you from tearing your hair out over such problems by providing you with some simple tips on how to find and fix errors in JavaScript programs.
Storing the information you need — Variables
After reading the last couple of articles you should now know what JavaScript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a high level. In this article we will get down to the real basics, looking at how to work with most basic building blocks of JavaScript — Variables.
Basic math in JavaScript — numbers and operators
At this point in the course we discuss maths in JavaScript — how we can combine operators and other features to successfully manipulate numbers to do our bidding.
Handling text — strings in JavaScript
Next we'll turn our attention to strings — this is what pieces of text are called in programming. In this article we'll look at all the common things that you really ought to know about strings when learning JavaScript, such as creating strings, escaping quotes in string, and joining them together.
Useful string methods
Now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
In the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name. Here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides.


The following assessment will test your understanding of the JavaScript basics covered in the guides above.

Silly story generator
In this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories. Have fun!


 此頁面的貢獻者: jackblackevo, SoniaBeesee
 最近更新: SoniaBeesee,