mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-04 22:07:52 +02:00
[javascript/en] Move comparisons to other languages into preamble
This commit is contained in:
@@ -16,9 +16,14 @@ JavaScript isn't just limited to web browsers, though: Node.js, a project that
|
|||||||
provides a standalone runtime for Google Chrome's V8 JavaScript engine, is
|
provides a standalone runtime for Google Chrome's V8 JavaScript engine, is
|
||||||
becoming more and more popular.
|
becoming more and more popular.
|
||||||
|
|
||||||
|
JavaScript has a C-like syntax, so if you've used languages like C or Java,
|
||||||
|
a lot of the basic syntax will already be familiar. Despite this, and despite
|
||||||
|
the similarity in name, JavaScript's object model is significantly different to
|
||||||
|
Java's.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Comments are like C's. Single-line comments start with two slashes,
|
// Single-line comments start with two slashes.
|
||||||
/* and multiline comments start with slash-star
|
/* Multiline comments start with slash-star,
|
||||||
and end with star-slash */
|
and end with star-slash */
|
||||||
|
|
||||||
// Statements can be terminated by ;
|
// Statements can be terminated by ;
|
||||||
@@ -194,8 +199,6 @@ myObj.myFourthKey; // = undefined
|
|||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// 3. Logic and Control Structures
|
// 3. Logic and Control Structures
|
||||||
|
|
||||||
// The syntax for this section is almost identical to Java's.
|
|
||||||
|
|
||||||
// The `if` structure works as you'd expect.
|
// The `if` structure works as you'd expect.
|
||||||
var count = 1;
|
var count = 1;
|
||||||
if (count == 3){
|
if (count == 3){
|
||||||
|
Reference in New Issue
Block a user