From 446cbe813c180e80cc6d137dfbc51371beba9f38 Mon Sep 17 00:00:00 2001 From: soon Date: Tue, 22 Oct 2019 14:41:09 +0000 Subject: [PATCH] Update Readme.md --- source/3-InfiniteLoops/Readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/3-InfiniteLoops/Readme.md b/source/3-InfiniteLoops/Readme.md index 64069d0..872d3ae 100644 --- a/source/3-InfiniteLoops/Readme.md +++ b/source/3-InfiniteLoops/Readme.md @@ -308,6 +308,10 @@ As the array index is started with [0], therefore each index is mapped the value `let yPos = [1,2,3,4];` -> `yPos.length: ypos[0] = 1, yPos[1] = 2, yPos[2] = 3, yPos[3] = 4` +Other methods of an array would be useful: +- `array.push(value)` (ref:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) : To add a value the end of the array. Example: `xPos.push(6)`, this will extend the index to xPos[5] = 6. +- `array.splice()` (ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice): This is to remove a range of an array index, or remove existing index and replace with new indexes with other value. + ### 3.10 Conditional Statements Conditional statements is very useful because it allows you to set different path of the decision by specifying conditions. Indeed, conditional decision is something not only specific to programming: -- GitLab