Extenza-Academy / WebDev-100_2021-Q1

24 Lessons, 12 Weeks, Get Started as a Web Developer
2 stars 0 forks source link

2.4.6. Assignment #66

Open mserykh opened 3 years ago

mserykh commented 3 years ago

Assignment

Loop an Array

Instructions

Create a program that lists every 3rd number between 1-20 and prints it to the console.

TIP: use a for-loop and modify the iteration-expression

Rubric

Criteria Exemplary Adequate Needs Improvement
Complete solution is presented Partial solution is presented Solution with bugs is presented
raybags-dev commented 3 years ago

/ lists every 3rd number between 1-20 and prints it to the console : used a function expression with an aggregate parameter as an argument for the loop to print every 3rd integer up to but not including 20/

const oddPrint = aggregate =>{
    !aggregate ? console.error("input is required") : true;

       for(let a = 1; a <= aggregate; a++) (a % 3 === 0)? console.log(a) : false;  
   }

oddPrint();