Blog

Archive for the Algorithms Category


In JavaScript Write an Array Containing 10 Arrays
Posted on June 8, 2015 in Algorithms, JavaScript by Matt Jennings

In JavaScript create an array containing 10 arrays. Those 10 separate arrays should each contain a randomly selected string value …

Read more


In JavaScript Write a Function to Split a String USING split();
Posted on June 5, 2015 in Algorithms, JavaScript by Matt Jennings

function mySplit(string, delimiter) {
var strArray = string.split(delimiter);
return strArray;
}

console.log(mySplit(“hello world and stuff”, ” “));


In JavaScript Write a Function to Split a String without using split();
Posted on June 5, 2015 in Algorithms, JavaScript by Matt Jennings

/* Function to Split a String into an Array using a single space as a
delimiter without using the split(); function
*/

function …

Read more


In JavaScript Create an Array with Odd Numbers
Posted on June 4, 2015 in Algorithms, JavaScript by Matt Jennings

Create an array with odd numbers from 1 to 255 and print out this array:

var y = [];

for(var i = …

Read more


In JavaScript Find the Average of the Sum of All Elements in an Array
Posted on June 3, 2015 in Algorithms, JavaScript by Matt Jennings

var x = [3, 9, 6];
var sum = 0;

for(var i = 0; i < x.length; i++) {

Read more