Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The value between the two adjacent commas is shown as "undefined" in the response to entry of arr = [1,2,,4] (see section "1st "write some code"). However, as the answer to the 2nd part of this task (see below the dotted line) demonstrates, it appears that undefined equates to a null.
- 1st "write some code":
- > arr = [1,2, ,4]
- ==> [1,2,undefined × 1,4]
- > arr[1]
- ==> 2
- >arr[2]
- ==> undefined
- ---------------------------
- [1,2,undefined,4].toString() === [1,2,,4].toString()
- ==> true
- or
- [1,2,null,4].toString() === [1,2,,4].toString()
- ==> true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement