My confusion is cleared.
arrSnake=[{x:0,y:1}]
inputDir={x:0,y:1}
are 2 different object names. It doesn't matter if we use same key name for both of them.
Update: These are the helpful things that I found from my research.
1) Wes bos 30 days of javascript.
2) https://www.freecodecamp.org/news/javascript-projects-for-beginners/
3) Go to codewars easier challenges
Exercises:
Write a function that takes an array of numbers and returns the largest number in the array.
Write a function that takes an array of strings and returns a new array containing only the strings that are shorter than 4 characters.
Write a function that takes an array of numbers and returns a new array containing only the even numbers from the original array.
Write a function that takes an array of numbers and returns the sum of all the numbers in the array.
Write a function that takes an array of words and returns a new array containing only the words that are palindromes (words that are spelled the same forwards and backwards, like "racecar" or "level").
Try writing some code using loops, if statements etc to
- create a new array that is the reverse of the old array
- reverse an array by modifying it in place
- see what happens if you use the `delete` keyword on an array element
- see what happens if you index or `.find` an element that doesn't exist
- try out the built-in functions `map`, `filter`, `reduce`. See if you can get an intuition for what they do and how they're generally useful
My university programming course assignments.
Based on research, I think I should keep learning more of javascript for the time being.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.