Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

55
Views
Javescript create list of numbers 0 to n

Sorry, I dont know anything about programming, so bare with me. I need an expression for a textlayer in adobe after effects which uses javascript. The expression needs to create a customizable list of numbers using 3 variables - example:

x = 0 //starting point (the first number in the list)
y= 20 //increments (the size of the steps)
z= 5 //the number of steps

the output needs to be a list with each entry in a new line, in this case:

0
20
40
60
80

Hope somebody can help. Thanks

7 months ago · Juan Pablo Isaza
2 answers
Answer question

0

x = 0 //starting point (the first number in the list)
y= 20 //increments (the size of the steps)
z= 5 //the number of steps
let output=[]
for(let i=x;i<z;i++){
  console.log(i*y)
  output.push(i*y)
}
console.log(output)

7 months ago · Juan Pablo Isaza Report

0

let arr = [];

let x = 0;
let y = 20;
let z = 5;

for (let i = 0; i < z * y; i+= y) {
  arr.push(i);
}

console.log(arr);

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.