[toc]
Code is a set of instructions for a computer to follow.
Here's a short list:
- Interact with users.
- Ineract with other systems.
- Repeat tedious tasks.
- Reuse useful code snippets.
- Make decisions. (Well, not the hard ones.)
Syntax referes to the structure of a language and the rules about that structure.
JavaScript, and other languages, can oly run if a program is syntactically correct, and each language is pretty rigid and unforgiving if you make a mistake.
A comment is text within a program intended to run for a human reader. It is completely ignored by the compiler or interpreter.
In Javascript, the // toke starts a comment, and the rest of the line gets gnored. For comments streched over multiple lines, the text falls between the symbols /* */.
// Single line comment
console.log("Hello, World!"); // The rest of this line is comments.
/* These comments crossing
* multi-line of JavaScript
* written as haiku!
*/🎗️ TODO: Create a list of escape characters later in the Computer Science folder.
| Sequence | Meaning | Notes |
|---|---|---|
\n |
New Line | |
\t |
(Horizontal) Tab | Some editors process tabs equivalent to at least four spaces. |
\' |
Single Quote | Use this in single quoted strings. |
\" |
Double Quote | Use this in a double quote string. |
Congradulations! You finished the prep work reading for LC101.
Some adive:
- Take advangage of the resources at your disposal--Your instructors, TAs, and classmates are here to help.
- Complete all the homework and practice taks. To learn how to code, you need to code.
- Ask and answer questions.
- Recognize that making mistakes is part of the learning process.
🏁 CHECKPOINT! Now you can do that Prep Work Quiz (or look over those last three chapters again.)
Ether way, let's move forward!
🏁 That was quick. Up next Data and Variables.
#LaunchCode