Answers for "javascript for function"

220

javascript for loop

var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) { 
  console.log(colors[i]);
}
Posted by: Guest on June-17-2019
3

How to create a function in javascript

function addfunc(a, b) {
  return a + b;
  // standard long function
}

addfunc = (a, b) => { return a + b; }
// cleaner faster way creating functions!
Posted by: Guest on April-04-2020
-1

function js

function toCelsius(fahrenheit) {
  return (5/9) * (fahrenheit-32);
}
Posted by: Guest on December-18-2020

Code answers related to "javascript for function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language