Javascript increment a variable in a function

Hey guys I’m new to programming, I need to make a website for school. I want to open the next page when pressing the arrow keys. So I thougt, I can put the URLs into an array an increment the index, …

Iterating through a an array executing a switch statement returns TypeError: Cannot assign to read only property ‘location’ of object ‘#’

I have a read only array that i copied to become a mutable array let mutableForecast = […forecast] I am taking that new array and iterating through it with forEach so i can mutate the array. im …

Use switch to take in unknown data types, issue with taking in an object

In the below code I am trying to make a switch statement that takes in the following inputs: 34, ’34’, {input: 34}, hello, [“hello”] and returns the number 34 within each input, the cases I …

javascript fizzbuzz switch statement

I’m currently taking the code academy course on Javascript and I’m stuck on the FizzBuzz task. I need to count from 1-20 and if the number is divisible by 3 print fizz, by 5 print buzz, by both print fizzbuzz, else just print the number. I was able to do it with if/ else if statements, but I wanted to try it with switch statements, and cannot get it. My console just logs the default and prints 1-20. Any suggestions? Answer Switch matches the x in switch(x){ to the result of evaluating the case expressions. since all your cases will