Skip to content

Commit d2b91f8

Browse files
committed
minor fixes
1 parent 3bbfae2 commit d2b91f8

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

JavaScript-Quick-Reference.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -377,19 +377,16 @@ switch (expression) {
377377
## 3.4 ARRAYS
378378
Detailed guide on JavaScript Arrays, covering array manipulation methods, iteration, and array-specific operations.
379379

380-
### Global object: properties
380+
### Properties
381381
- `Array.length` Reflects the number of elements in an array.
382382
- `Array.prototype` Represents the prototype for the Array constructor and allows to add new properties and methods to all Array objects.
383383

384-
### Global object: methods
384+
### Methods
385385
- `Array.from(arrayLike[, mapFn[, thisArg]])` Creates a new Array instance from an array-like or iterable object.
386386
- `Array.isArray(obj)` Returns true if a variable is an array, if not false.
387387
- `Array.of(element0[, element1[, ...[, elementN]]])` Creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.
388388

389-
### **Instance: properties
390-
- `arr.length` Reflects the number of elements in an array.
391-
392-
### Instance: mutator methods
389+
### Mutator Methods
393390
- `arr.copyWithin(target, start, end)` Copies a sequence of array elements within the array.
394391
- `arr.fill(value, start, end)` Fills all the elements of an array from a start index to an end index with a static value.
395392
- `arr.pop()` Removes the last element from an array and returns that element.
@@ -401,7 +398,7 @@ Detailed guide on JavaScript Arrays, covering array manipulation methods, iterat
401398
- `array.splice(start, deleteCount, item1, item2, ...)` Adds and/or removes elements from an array.
402399
- `arr.unshift([element1[, ...[, elementN]]])` Adds one or more elements to the front of an array and returns the new length of the array.
403400

404-
### Instance: accessor methods
401+
### Acessor Methods
405402
- `arr.at(index)` Returns the element at the specified index in the array.
406403
- `arr.concat(value1[, value2[, ...[, valueN]]])` Returns a new array comprised of this array joined with other array(s) and/or value(s).
407404
- `arr.includes(searchElement, fromIndex)` Determines whether an array contains a certain element, returning true or false as appropriate.
@@ -412,7 +409,7 @@ Detailed guide on JavaScript Arrays, covering array manipulation methods, iterat
412409
- `arr.toString()` Returns a string representing the array and its elements. Overrides the Object.prototype.toString() method.
413410
- `arr.toLocaleString(locales, options)` Returns a localized string representing the array and its elements. Overrides the `Object.prototype.toLocaleString()` method.
414411

415-
### Instance: iteration methods
412+
### Iteration Methods
416413
- `arr.every(callback[, thisArg])` Returns true if every element in this array satisfies the provided testing function.
417414
- `arr.filter(callback[, thisArg])` Creates a new array with all of the elements of this array for which the provided filtering function returns true.
418415
- `arr.find(callback[, thisArg])` Returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
@@ -431,20 +428,20 @@ Detailed guide on JavaScript Arrays, covering array manipulation methods, iterat
431428
## 3.5 OBJECTS
432429
Overview of JavaScript Object, its properties, and methods.
433430

434-
### Creating an object
431+
### Creating an Object
435432
`const myObject = { key1: 'value1', key2: 'value2' };` Object literal with two properties
436433

437-
### Accessing properties
434+
### Accessing Properties
438435
- `console.log(myObject.key1);` 'value1'
439436
- `console.log(myObject['key2']);` 'value2'
440437

441-
### Adding properties
438+
### Adding Properties
442439
`myObject.key3 = 'value3';` Adding a new property 'key3'
443440

444-
### Deleting properties
441+
### Deleting Properties
445442
`delete myObject.key2;` Removing property 'key2'
446443

447-
### Methods of the Object constructor
444+
### Methods of the Object Constructor
448445
- `Object.assign(target, ...sources)` Copies values from source to target objects.
449446
- `Object.create(proto, propertiesObject)` Creates a new object with the specified prototype and properties.
450447
- `Object.defineProperty(obj, prop, descriptor)` Defines a new property on an object.
@@ -481,7 +478,7 @@ for (const key in myObject) {
481478
Overview of error handling mechanisms in JavaScript.
482479

483480
### try...catch statement
484-
Handles exceptions by testing a block of code for errors
481+
Handles exceptions by testing a block of code for errors.
485482

486483
```javascript
487484
try {
@@ -492,7 +489,7 @@ console.log(error); // Handling the error
492489
```
493490

494491
### try...catch...finally statement
495-
Includes a block that runs regardless of the result
492+
Includes a block that runs regardless of the result.
496493

497494
```javascript
498495
try {
@@ -505,7 +502,7 @@ try {
505502
```
506503

507504
### throw statement
508-
Creates a custom error
505+
Creates a custom error.
509506

510507
```javascript
511508
function checkNumber(num) {

0 commit comments

Comments
 (0)