Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active November 20, 2021 00:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/460cd0e085cfd95f4165c595300fa3d1 to your computer and use it in GitHub Desktop.
Save McLarenCollege/460cd0e085cfd95f4165c595300fa3d1 to your computer and use it in GitHub Desktop.
Exercise : User Array Operations
  • You are given the following array
let userA = [
  22,
  false,
  "vivek",
  "India",
  ["Hiking", "Fishing", "Reading"],
  [
    [72, 60],
    [88, 20],
    [50, 36],
  ],
];
  • Task1 : Write the code to increase age (22) by 1
  • Task2 : Add new hobby "Swimming" to Hobby Array
  • Task3 : Create a locations variable and point it to the last element of userA
  • Task4 : Using the loctions variable, add a new location [50,70] to that array
  • Task5 : For the first location, increment the longitude value from 60 to 61.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment