MCPcopy Create free account

hub / github.com/StevanCakic/js-hard-parts / functions

Functions56 in github.com/StevanCakic/js-hard-parts

↓ 3 callersFunctionfakeAPICall
5. Promises/index.js:110
↓ 2 callersFunctionnextIterator
* Create an iterator with a next method that returns each value of the array when .next is called.
6. Iterators/index.js:47
↓ 2 callersFunctionouter
* Examine the code for the outer function. Notice that we are returning * a function and that function is using variables that are outside of its sco
2. Closure, Scope and ExecutionContext/index.js:48
↓ 2 callersFunctionreduce
* The function reduce takes an array and reduces the elements to a single value. For example it can sum all the numbers, multiply them, or any ope
1. Callbacks and Higher-Order Functions/index.js:100
↓ 1 callersFunctionaddByX
* Now we are going to create a function addByX that returns a function * that will add an input by x
2. Closure, Scope and ExecutionContext/index.js:76
↓ 1 callersFunctionadminFactory
* Create an adminFactory function that creates an object * with all the same data fields (and default values) as objects * of the userFactory class,
4. OOP/index.js:237
↓ 1 callersFunctionafter
* Write a function after that takes the number of times the callback * needs to be called before being executed as the first parameter * and the cal
2. Closure, Scope and ExecutionContext/index.js:134
↓ 1 callersFunctioncreateConversation
* Write a function that will console.log "hello there", or "gibberish", every three seconds depending on if the word passed into the function is 'engl
6. Iterators/index.js:198
↓ 1 callersFunctiondelay
* Write a function delay that returns a promise. And that promise should return a setTimeout that calls resolve after 1000ms
5. Promises/index.js:66
↓ 1 callersFunctiondelay
* Write a function delay that accepts a callback as the first parameter * and the wait in milliseconds before allowing the callback to be invoked *
2. Closure, Scope and ExecutionContext/index.js:163
↓ 1 callersFunctionf
(noun)
6. Iterators/index.js:223
↓ 1 callersFunctionforEach
(array, callback)
1. Callbacks and Higher-Order Functions/index.js:57
↓ 1 callersFunctiongetAllData
()
5. Promises/index.js:121
↓ 1 callersFunctionindexIterator
* Create an iterator with a next method that returns an array with two elements * (where the first element is the index and the second is the value a
6. Iterators/index.js:118
↓ 1 callersFunctionmakePerson
* Create a function that accepts two inputs (name and age) and returns an object. * Let's call this function makePerson. This function will: * creat
4. OOP/index.js:18
↓ 1 callersFunctiononce
Write a function once that accepts a callback as input and returns a function. When the returned function is called the first time, it should call
2. Closure, Scope and ExecutionContext/index.js:110
↓ 1 callersFunctionpersonFromConstructor
* personFromConstructor that takes as input a name and an age. * When called, the function will create person objects using the new keyword * instea
4. OOP/index.js:116
↓ 1 callersFunctionpersonFromPersonStore
* Create a function personFromPersonStore that takes as input a name and an age. * When called, the function will create person objects using the Obj
4. OOP/index.js:57
↓ 1 callersFunctionreturnIterator
(arr)
6. Iterators/index.js:24
↓ 1 callersFunctionsayHello
* Let's start by reviewing asynchronous functions! Using setTimeout, print the string 'Hello!' after 1000ms.
5. Promises/index.js:7
↓ 1 callersFunctionsetIterator
* Create an iterator with a next method that returns each value of a set when .next is called
6. Iterators/index.js:95
↓ 1 callersFunctionsumArray
* Write code to iterate through an entire array using your nextIterator and sum the values.
6. Iterators/index.js:75
↓ 1 callersFunctionsumFunc
(arr)
6. Iterators/index.js:11
↓ 1 callersFunctionuserFactory
(name, score)
4. OOP/index.js:200
↓ 1 callersFunctionvalueAndPrevIndex
* Build a function that walks through an array and returns the element concatenated * with the string "was found after index x", where x is the prev
6. Iterators/index.js:174
↓ 1 callersFunctionwaitForVerb
* Use async/await to console.log a sentence comprised of a noun and verb in which the non async function takes in a noun, * concatenates it with a ha
6. Iterators/index.js:216
FunctionPersonConstructor
* Create a function PersonConstructor that uses the this keyword to save * a single property onto its scope called greet. greet should be a function
4. OOP/index.js:96
FunctionWords
* Create an iterator that returns each word from a string of words on the call of its .next method (hint: use regex!) Then attach it as a method
6. Iterators/index.js:143
Functionadd
(num)
2. Closure, Scope and ExecutionContext/index.js:77
FunctionaddS
(word)
1. Callbacks and Higher-Order Functions/index.js:16
FunctionaddTwo
(num)
1. Callbacks and Higher-Order Functions/index.js:6
FunctionbrokenRecord
* Create a function brokenRecord that console logs hi again every second. * Use the End Code button to stop the console logs when you are * satisfie
3. Async/index.js:52
FunctioncallCallback
(num)
2. Closure, Scope and ExecutionContext/index.js:113
Functioncalled
()
2. Closure, Scope and ExecutionContext/index.js:145
Methodconstructor
(name)
4. OOP/index.js:153
Methodconstructor
(name)
4. OOP/index.js:177
FunctioncreateFunction
* Create a function createFunction that creates and returns a function. * When that created function is called, it should print "hello".
2. Closure, Scope and ExecutionContext/index.js:11
FunctioncreateFunctionPrinter
* Create a function createFunctionPrinter that accepts one input and returns * a function. When that created function is called, it should print out
2. Closure, Scope and ExecutionContext/index.js:28
FunctiondelayedGreet
* Create a function delayedGreet that console logs welcome after 3 seconds.
3. Async/index.js:26
FunctioneveryXsecsForYsecs
* Write a function called everyXsecsForYsecs that will accept three arguments: * a function func, * a number interval, * and another number duratio
3. Async/index.js:102
FunctionexecuteCallback
()
2. Closure, Scope and ExecutionContext/index.js:136
Methodgreet
()
4. OOP/index.js:157
FunctionhelloGoodbye
* Create a function helloGoodbye that console logs hello right away, * and good bye after 2 seconds.
3. Async/index.js:38
FunctionincrementCounter
()
2. Closure, Scope and ExecutionContext/index.js:50
Functionintersection
* Construct a function intersection that compares input arrays and returns a new array * with elements found in all of the inputs. BONUS: Use reduce
1. Callbacks and Higher-Order Functions/index.js:119
Methodintroduce
()
4. OOP/index.js:180
FunctionlimitedRepeat
* Create a function limitedRepeat that console logs hi for now every * second, but only for 5 seconds. * Research how to use clearInterval if you ar
3. Async/index.js:75
Functionmap
(array, callback)
1. Callbacks and Higher-Order Functions/index.js:33
FunctionmapWith
* In the first part of the extension, you're going to rebuild map as mapWith. * This time you're going to use forEach inside of mapWith instead of us
1. Callbacks and Higher-Order Functions/index.js:81
FunctionmultiMap
Construct a function multiMap that will accept two arrays: an array of values and an array of callbacks. multiMap will return an object whose key
1. Callbacks and Higher-Order Functions/index.js:212
FunctionobjOfMatches
Construct a function objOfMatches that accepts two arrays and a callback. objOfMatches will build an object and return it. To build the object,
1. Callbacks and Higher-Order Functions/index.js:183
FunctionprintHello
()
2. Closure, Scope and ExecutionContext/index.js:12
FunctionprintInput
()
2. Closure, Scope and ExecutionContext/index.js:29
FunctionsayHowdy
* Thinking point (no writing code necessary for this challenge): * Inspect the code given to you in Challenge 1. * In what order should the console
3. Async/index.js:11
FunctiontestMe
()
3. Async/index.js:15
Functionunion
Construct a function union that compares input arrays and returns a new array that contains all elements. If there are duplicate elements, only add
1. Callbacks and Higher-Order Functions/index.js:154