Skip to content

gSchool/quick-check-20170110

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Quick Check

Re-write this function to get it to work without errors and to return the product of two numbers

funtion multiply(x) (
  x + y
)

-- YOUR ANSWER HERE --

Explain each of the below versions of writing functions

For each, answer:

  • Is this ES5 or ES6?
  • Is the function anonymous?
  • How do you call the function?

First

function add(x, y) {
  return x + y
}

-- YOUR ANSWER HERE --

Second

var add = function (x, y) {
  return x + y
}

-- YOUR ANSWER HERE --

Third

var add = (x, y) => {
  return x + y
}

-- YOUR ANSWER HERE --

Fourth

function add(x, y) {
  return x + y
}

var obj = {
  add: add
}

-- YOUR ANSWER HERE --

Fifth

var obj = {
  add: function (x, y) {
    return x + y
  }
}

-- YOUR ANSWER HERE --

Sixth

var obj = {
  add(x, y) {
    return x + y
  }
}

-- YOUR ANSWER HERE --

What does the following code output to the console?

var i = 0
for ( console.log('Bob'); (console.log('Curly') === undefined); console('Mo') ) { 
  console.log(++i)
  if (i >= 2)
    break
}
console.log(i)

-- YOUR ANSWER HERE --

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors