Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.6. Assignment #66

Open
mserykh opened this issue Dec 30, 2020 · 1 comment
Open

2.4.6. Assignment #66

mserykh opened this issue Dec 30, 2020 · 1 comment

Comments

@mserykh
Copy link
Collaborator

mserykh commented Dec 30, 2020

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
Copy link

raybags-dev commented Dec 31, 2020

/* 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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants