Skip to content

FullstackAcademy/Pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patterns

In this problem set, you'll learn some common coding patterns that you'll use for the rest of your programming career!

Instructions

Test files are already written for you in the __tests__ folder. Complete the functions in the patterns folder according to each section below. The first problem of each section comes with a sample solution that you can use as reference.

Guard

A guard is a conditional usually placed at the beginning of a function that prevents the rest of the function from being run if certain conditions are not met. A function can have more than one guard.

Complete the functions in guard.js to pass the tests in guard.test.js.

Accumulator Variable

An accumulator variable is used to keep track of information as a program executes, usually alongside a loop. Sometimes, the accumulator variable might update depending on a condition.

Complete the functions in accumulator.js to pass the tests in accumulator.test.js.

Return Timing

Almost all of the functions we've seen so far return something at the very end. If we already have an answer, we don't always need to iterate through the entire array. For these problems, think about what to return and when to return!

Complete the functions in timing.js to pass the tests in timing.test.js.

Nested Loops and Arrays

You can loop inside a loop, and you can have arrays of arrays!

Complete the functions in nested.js to pass the tests in nested.test.js.

Submission

Please submit the link to your public GitHub repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published