I have followed along with video from video number 72 of the Udemy "last Intro to Programming Course". I have moved code that was included all in one function to another function called "draw" I have reviewed the video multiple times and I cannot see any difference between my code and the video. The goal ..
Category : function
I want a function that takes the name of the row in the JSON file and returns a list of elements from that row based on that argument… if "DRIVER" is called then I should get all the drivers in that row, if "COMPANY" is called, then all the companies…I’ve done several attempts to get ..
I wrote a function that returns a day of the week given a number (1 = Monday, 2 = Tuesday etc) and I was supposed to create a caveat where if the number was less than 1 or greater than 7, the function should return null. Why is it instead returning undefined for 0 and ..
I want to play my audio source automatically when I scored a goal in my minigame. This is the current code I have but I couldn’t figure out where do I have to place my variable to play my audio source. Im new to JS so im in a learning proces 🙂 var audio = ..
so I want to add one more function to make a total of 3 functions to this onclick event that changes depending on how many times you click on the button. I am just not sure how to add a third function. <div class="base" id="base"> <img src="img/base.svg"> </div> <div class="base one" id="one"> <img src="img/one.svg"> </div> ..
Please help me when I am using the setInterval () function then suddenly while using clearInterval (), everything works fine. But Automatic working li elements with class automatically stopped working. anybody have any solution or idea how to fix this error, after using the previous and next button how to run setInterval() again Any kind ..
I am trying to call a function whose name is in a variable like this: const funcNames = [ "func1", "func2", "func3" ]; someElem.funcNames[0](someArg); Here I want funcName’s 0 index element to be the name of the function I want to call on someElem (with args) I hope I was able to explain and I ..
lets take this example function main (x) { return x } function second() { console.log("hello ") } js compiler knows all function declarations so I can call second inside main main(second()) what I dont get about recursive functions is that how the same function can be called inside the function declaration function factorial(n) { if (n ===1) ..
I’d like to show different messages on certain dates, e.g. show "Hello World!" on April 21, "Good afternoon" on April 22, "Happy birthday!" on April 23 and so on. Could someone possibly help me? Source: Ask Javascript..
Currently, on code.org, I have a project where you need to guess a dinosaur fossil from a list of them. What I have envisioned is to be given 4 options and a picture, however I don’t know how to make sure that one of the buttons randomly gets the correct answer, while the other 3 ..
Recent Comments