Here we go again! This time, we are going to be working on Pairwise. This is a tough one for beginners, but do not worry, let’s go slow and get this beast under control and understand […]
FCC Bonfire Series 140: Map the Debris
Today’s bonfire, once again, will have us deal with objects. This time, in Map the Debris, we must write a function that, given an array of elements (satellites) and their average altitudes, must return their […]
FCC Bonfire Series 139: Make a Person
Today, we are going to be making a person (not in that sense, you) using a constructor function. When this function get’s called using the new keyword, it will construct and return an object, that’s why […]
FCC Bonfire Series 138: Arguments Optional
Arguments Optional, oh boy, this is the last challenge before we get to the advanced bonfires section. This bonfire will show us some very interesting facts about JavaScript functions.
For this task, we are asked to write a function that accepts either one or two arguments. If two arguments are provided (and both are numbers), we proceed to return the sum; but, if we are only given a single argument, we must return a function. This returned function will accept one number as argument, and will return the sum of it and the originally passed number. Let’s see a few examples:
addTogether(5, 6); //-> 11 add(11, 53); //-> 64 var addFive = addTogether(5); addFive(6); //-> 11 var addEleven = addTogether(11); addEleven(53); //-> 64
FCC Bonfire Series 137: Everything be true
Today, we’ll deal with objects, for objects are wonderful! Everything be true will have us write a function that takes in 2 arguments. The first will be an array of objects (also called a collection), and […]