Functions in Javascript
Assess your knowledge of functions in Javascript by implementing the following functions.
We'll cover the following...
Assess your skills
Test yourself by using an array as an argument when calling a function.
// Return what fn returns using arr as argumentsargsAsArray = function(fn, arr) {}
Test yourself by changing the context in which a function is called.
// Return what fn returns with obj as its contextspeak = function(fn, obj) {}
Test yourself by returning a function from a function.
// Return a function that takes an argument// and concats 'str' and the argumentfunctionFunction = function(str) {}
Evaluate yourself by implementing the closures.
// Return an array of closures calling fn on array itemsmakeClosures = function(arr, fn) {}
Evaluate yourself by creating a partial function.
// Return a function that takes one arg// and return the result of fn with str1,// str2 and arg.partial = function(fn, str1, str2) {}
Test yourself by using the arguments object.
// Returns sum of all argumentssumArguments = function() {}
Test yourself by applying functions with arbitrary numbers of arguments.
// Call fn with all the arguments// and return resultscallIt = function(fn) {}
Test yourself by creating a partial function for a variable number of applied arguments.
// Returns a function that takes calls// fn with all the arguments passed to this function// and to the function that's returned.partialUsingArguments = function(fn) {}
Ask