Skip to content

The-Marcy-Lab-School/swe-sr-1-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

swe-sr-1-3

For guidance on setting up and submitting this assignment, refer to the Marcy lab School Docs How-To guide for Working with Short Response and Coding Assignments.

Prompt 1

Read the findIndex documentation on MDN. Explain the difference between findIndex and indexOf. Provide an example to enhance your response.

Response 1

Add your response here...

Prompt 2

The callback that you provide to forEach, filter, or map can include up to three parameters.

const arr = ['a', 'b', 'c', 'd'];

arr.forEach((param1, param2, param2) => {

});

What values will be provided to those three parameters? To support your response, provide an example of how you might use all three parameters to do something.

Response 2

Add your response here...

Prompt 3

According to our style guide (adopted from AirBnb), it is recommended that you only use array higher-order functions like forEach instead of for loops.

What do you see as the benefit of doing this?

Response 3

Add your response here...

Prompt 4

Below is a regular expression that can be used to identify emails. Explain how it identifies the three portions of an email!

/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/

Tip: Visit https://regexr.com/ to learn Regex and to help understand regular expressions.

Response 4

Add your response here...

Prompt 5

Imagine you are teaching a brand new programmer a brief lesson about callback functions. Your lesson should have the following components:

  • An explanation of the concept with an analogy ("A callback function is a ... It is like a ...")
  • An example of the syntax for a higher-order function that accepts a callback.
  • An explanation of the syntax using the terms callback, higher order function

Below, we've provided an outline for your response but feel free to modify it as you see fit.

Response 5

Explanation of the concept with an analogy.

Check out this example:

// Add your example here

Explanation of the syntax.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published