Skip to content

Commit

Permalink
objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerabrodi committed May 18, 2024
1 parent 739fa5a commit d35b63e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
16 changes: 16 additions & 0 deletions 4-objects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ console.log(person.name); // Lydia
console.log(person["age"]); // 21
```

# Short-hand property names

If you have variables with the same name as the key names, you can use the shorthand property name syntax:

```js
const name = "Lydia";
const age = 21;

const person = {
name,
age,
};
```

Here, the properties `name` and `age` will be created with the values of the variables `name` and `age`. No need to repeat the variable names!

# Destructuring

Destructuring allows you to extract multiple properties from an object and store them in variables. Here's an example:
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Outline:
- Destructuring arrays
7. **Functions**
- Function declaration and expression
- Arrow functions
- `this` context
- Closures
- Higher-order functions
- Returning functions
- Closures
- Practical examples of complex functions (e.g., deep cloning an object)
8. **Prototypes and Inheritance**
- Prototype in JavaScript, `__proto__`
- Why JavaScript has prototypes
Expand All @@ -44,16 +45,35 @@ Outline:
14. **Intervals and Timeouts**
- Ins and outs of `setInterval` and `setTimeout`
- Tips and tricks, such as implementing your own throttling function
15. **Promises and Async/Await**
15. **Promises**
- Explaining what promises are and their states
- Microtask queue and the event loop
- Creating promises with `new Promise`
- Chaining promises with `.then`
- Handling errors with `.catch`
- Promises and the event loop
16. **Async Functions, async/await**
- an async function automatically returns a promise
- `await` keyword
- Error handling with `try...catch`
- Patterns and tricks when working with promises
16. **HTTP and Fetch API**
17. **HTTP and Fetch API**
- HTTP methods explained
- Fetch API: Understanding responses, `response.json()`, handling errors
- HTTP status codes
17. **JavaScript Modules**
18. **JavaScript Modules**
- Named and default imports
- Import syntax using relative paths
- Renaming imports

---

More ideas for the course:

- hidden classes
- performant javascript
- map
- sets
- weakmap
- regexes
- custom errors
- fun functions such as `debounce`, `throttle`, `memoize`, deep clone etc. look at lodash and underscore for inspiration
- inversion of control

0 comments on commit d35b63e

Please sign in to comment.