Skip to content

LaunchCodeEducation/flexpath-revisit-functions-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flexpath-revisit-functions-exercises

Exercise overview

Now that you have the basics of JavaScript and working with JavaScript in the web down, we wanted to revisit some fundamental concepts and give you a deeper understanding of how to use them effectively in your programs.

These exercises will take a closer look at functions in JavaScript.

Getting Started

  1. Using Visual Studio Code, open the folder flexpath-revisit-functions-exercises wherever you saved it on your device.
  2. Then open the flexpath-revisit-functions-exercises/exercise folder. Inside are a collection of folders for each exercise. Exercise instructions are provided to you in .txt files in these folders.
  3. To test your code, you will open up your terminal, and navigate to the specific exercise_[number] folder inside of the larger exercises/ folder where you are working in, using the change directory command cd.
  4. You will then run the command node [filename].js to run whichever file in the folder you are working with, replacing [filename] in the command with the file's actual name.

Exercise solutions are in the /solution folder

We have also included a list of challenge problems for you to work with on your own in the future. THIS LIST IS OPTIONAL and is not required to graduate from the Flex Path course.

More details are available inside the OPTIONAL-challenge-problems-for-later folder.

Note:

For the first few exercises in this repository, we have included example JS code you can use to test your solutions.

But, after the first few exercises we don't provide it anymore.

As a Software Developer, you will have to both solve a problem given to you and come up with code on your own to test that your solution to that problem actually works.

This is an important skill to build, and it is vital to being able to do this job.

Therefore, we want you to start getting comfortable writing JavaScript code to test that your solutions work as intended.

 

Summary of JavaScript Concepts Covered in These Exercises

  1. Function Declarations and Expressions:

    • How to define functions using declarations and expressions.
    • Differences between the two, including hoisting behavior.
  2. Arrow Functions:

    • Syntax and differences from traditional function expressions.
    • Limitations of arrow functions, like the lack of this binding.
  3. Function Constructor:

    • Using the Function constructor to create functions dynamically.
  4. Recursion:

    • Understanding recursive functions and the importance of base cases.
  5. Immediately Invoked Function Expressions (IIFE):

    • Syntax and use cases for self-executing functions.
  6. Function Parameters:

    • Differentiating between parameters and arguments.
    • Concepts of pass-by-value and pass-by-reference.
    • Using default parameters for safer function calls.
    • Understanding and using the arguments object.
    • Using rest parameters to handle an indefinite number of arguments.
  7. Passing Functions as Arguments (Callbacks):

    • Creating higher-order functions that accept other functions as arguments.
    • Common use cases, like asynchronous programming with setTimeout and setInterval.
  8. Function Scope and Closures:

    • How variable scope works in JavaScript.
    • Understanding closures and how inner functions retain access to outer variables.
  9. The this Keyword:

    • How this behaves in different contexts (global, function, and method).
    • Differences in this behavior in arrow functions.
    • Using bind(), call(), and apply() to control this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published