Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
Created January 13, 2020 14:20
Show Gist options
  • Select an option

  • Save cesarkohl/8eedb4a3e732097581a36158a1b2c02e to your computer and use it in GitHub Desktop.

Select an option

Save cesarkohl/8eedb4a3e732097581a36158a1b2c02e to your computer and use it in GitHub Desktop.
var numbers = [1,2,3];
double var = [];
for (var i = 0; i <numbers.length; i ++) {
double.push (numbers [i] * 2);
}
console.log (numbers); // [1,2,3]
console.log (double); // [2,4,6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment