From cd6f143c32001a39df9f9c2ff3302ff5b3e55e79 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 16 Jan 2024 18:57:37 +1030 Subject: [PATCH] update asterisks to hyphens As per style guide, changed all asterisks to hyphens for all unordered list items This is so the markdown is consistent, even though either would render the same --- .../javascript_basics/fundamentals-1.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/foundations/javascript_basics/fundamentals-1.md b/foundations/javascript_basics/fundamentals-1.md index da6dfc0f204..d3ce1203784 100644 --- a/foundations/javascript_basics/fundamentals-1.md +++ b/foundations/javascript_basics/fundamentals-1.md @@ -5,19 +5,19 @@ In the previous sections you learnt how to structure webpages with HTML and styl This section contains a general overview of topics that you will learn in this lesson. -* How do you declare a variable? -* What are three different ways to declare a variable? -* Which one should you use when? -* What are the rules for naming variables? -* What are operators, operands, and operations? -* What is concatenation and what happens when you add numbers and strings together? -* What are the different types of operators in JavaScript? -* What is the difference between == and ===? -* What are operator precedence values? -* What are the increment/decrement operators? -* What is the difference between prefixing and postfixing them? -* What are assignment operators? -* What is the Unary Plus Operator? +- How do you declare a variable? +- What are three different ways to declare a variable? +- Which one should you use when? +- What are the rules for naming variables? +- What are operators, operands, and operations? +- What is concatenation and what happens when you add numbers and strings together? +- What are the different types of operators in JavaScript? +- What is the difference between == and ===? +- What are operator precedence values? +- What are the increment/decrement operators? +- What is the difference between prefixing and postfixing them? +- What are assignment operators? +- What is the Unary Plus Operator? ### How to run JavaScript code @@ -81,17 +81,17 @@ Try the following exercises (and don't forget to use `console.log()`!): 1. Add 2 numbers together! (just type `console.log(23 + 97)` into your html file) 2. Add a sequence of 6 different numbers together. 3. Print the solution to the following equation: `(4 + 6 + 9) / 77` - * Answer should be approximately `0.24675` + - Answer should be approximately `0.24675` 4. Let's use variables! - * Type this statement at the top of the script tag: `let a = 10` - * In the console `console.log(a)` should print `10` - * Try the following in the console: `9 * a` - * and this: `let b = 7 * a` (returns `undefined` \*) and then `console.log(b)` + - Type this statement at the top of the script tag: `let a = 10` + - In the console `console.log(a)` should print `10` + - Try the following in the console: `9 * a` + - and this: `let b = 7 * a` (returns `undefined` \*) and then `console.log(b)` 5. You should be getting the hang of this by now... try this sequence: - * Declare a constant variable `MAX` with the value `57` - * Set another variable `actual` to `MAX - 13` - * Set another variable `percentage` to `actual / MAX` - * If you type `percentage` in the console and press Enter you should see a value like `0.7719` + - Declare a constant variable `MAX` with the value `57` + - Set another variable `actual` to `MAX - 13` + - Set another variable `percentage` to `actual / MAX` + - If you type `percentage` in the console and press Enter you should see a value like `0.7719` 6. Take a few minutes to keep playing around with various things in your script tag. Eventually, we will learn how to actually make those numbers and things show up on the webpage, but all of this logic will remain the same, so make sure you're comfortable with it before moving on. _* As you might have noticed by running Javascript code in the console, the console prints the result of the code it executes (called a return statement). You will learn more about these in the next lessons, however for now it is good to remember that a declaration with an assignment (such as `let b = 7 * a`) returns `undefined` and so you cannot declare and assign a value to a variable and read its value in the same line._