Search Header Logo
JWD JS Function, Scoping, and program flow Overview

JWD JS Function, Scoping, and program flow Overview

Assessment

Presentation

Computers

University

Hard

Created by

Lazaro Alsina

Used 3+ times

FREE Resource

9 Slides • 0 Questions

1

JWD JS Function, Scoping, and program flow Overview

by Lazaro Alsina

2

​Today's overview:

  • ​Functions

  • ​Scoping

  • ​Arrays

  • ​Loops

  • ​Iterators

media
media

3

​Function in detail

  • ​What is a function

  • ​Calling a function

  • ​Functions and arguments

  • ​default parameters

  • Return

  • ​Helper functions

  • ​Arrow Functions

  • ​Concise Body Arrow Function

media

4

​Ways to make functions in JS

​A function is a group of code that is reused whenever it is called upon.

​The purpose is to reduce DRY, hard coding, and make the program more modules.

​There are a few ways you can create a function.

media
media

5

​Calling a function

​There are a few ways of calling a function.

​Depending on your case use will depend on what you or prefer to use.

​Either you write a function statement or an expression function. Use what works best for you.

media
media

6

​Functions and its Arguments

​Functions can have arguments, meaning we can put values for a function to execute and give us a result which is the answer.

​Keep in mind, we have been using arguments a lot when using

​console.log(argument).

media
media

7

​Default Parameters:

​Many functions, including methods that are like functions, have a default setting.

​These settings are made by the programmer and can be placed inside its parameters.

media
media

8

​Return:

​When we make functions, what is inside in most languages are private by default, meaning no other program can access the data inside but we can get an answer by using return.

​What is return is what we call the output from function.

media
media

9

​Helper Functions

​When using functions, we can call a function within a function!

​In short, we are calling a function within a function to give us a result which then the function that call it is now going to calculate it base on what was programmed.

media
media

JWD JS Function, Scoping, and program flow Overview

by Lazaro Alsina

Show answer

Auto Play

Slide 1 / 9

SLIDE