var a = 2;
console.log(a);
/*
*************************************************
Write a function to asynchronously iterate
through and process the elements of a
specified array.
REQUIREMENTS
~Your function should expect two parameters:
the first being the array of items to process,
and the second being a reference to an
external function that should be called in
order to process each item.
~The external function expects two parameters:
the first being an item to process, and the second
being a callback function that it will call once
it has finished processing the item. The
callback is important, because processing the
item is asynchronous (eg. it may involve an
AJAX request to a Web service).
~You don't have to implement the external function,
and it's not particularly relevant what it does
with each item.
~Your implementation must be encapsulated inside
a function. You may not write other functions
outside of it.
~Your implementation must not be destructive
to the items array parameter.
*****************************************************
*/
/*
function ProcessMyItem(idx){
//do something at a later time
//to process the index value
console.log('processItem method');
console.log(idx);
}
//FUNCTION: processItems
//-----------------------------------------------
//items: array to process
//-----------------------------------------------
//processItem: a reference to an
//external function that should be called in
//order to process each item.
function processItems (items,processItem) {
// FILL THIS IN
console.log('array to process');
console.log(items);
console.log('callback');
console.log(processItem);
}
var kids = ['Makayla', 'Kathryn', 'Bella'];
processItems(kids, checkOnKids);
*/
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.