Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

functions

  1. Gigiux

    JavaScript How to launch functions from JS setInterval?

    Hello, I am trying to understand the use of the function setInterval by drawing a Pacman that opens and closes its mouth. I understand that I can launch only one function from setInterval, and this function has to be a wrapper that launches other functions. I set a wrapper drawPac that launches...
  2. P

    JavaScript String.prototype.doStuff new function is never defined

    prototypes.js: if (!String.prototype.doStuff) { String.prototype.doStuff = (str) => { // do stuff to this with str return this.substring(0, this.length()); }; alert(typeof doStuff); // returns "undefined" and I don't know why } index.html: <html> <head>...
  3. P

    JavaScript How do I loop through an array and display each item in the HTML page on a new line?

    Hi, I am new to JS from Python. I am trying to create a To Do List in JS, and I am trying to loop over an array that contains the added items. I want each item in the array to appear on a new line in the web app. The best I can get is for the items to be displayed like this item1,item2,item3 I...
  4. N

    JavaScript get max sum of multiple functions

    I'm trying to get the largest number of this 3 functions then store in an array, the variables of that function and their amount..can be done? //this must be the result var result = [50,55,60,165] // function r2 function r1(){ var x = 5; var a = 10; var b = 10; return x+a+b // 25 } function...
Back
Top Bottom