Blog


PHP Function to Echo Out the Average of an Array
Posted on June 16, 2015 in PHP by Matt Jennings

<?php
// PHP function to echo out the average of an array

function compute_average($arr_to_avg)
{
$number_of_values = count($arr_to_avg);

Read more


In JavaScript Fibonacci Number Recursive Function Examples
Posted on June 16, 2015 in Algorithms, JavaScript by Matt Jennings

Basic Fibonacci Number examples with 4 as an input is below:

/*
Recursive function to return a single Fibonacci Number
*/

function …

Read more


In JavaScript Create a Function that Takes a Number to Return a Factorial
Posted on June 15, 2015 in Algorithms, JavaScript by Matt Jennings

function factorialInput(num) {
var factorial = 1;
for(var i = num; i > 0; i–) {

Read more


In JavaScript, a Function to Add Numbers from 1 to 4 Million Using the Modulus Operator
Posted on June 11, 2015 in Algorithms, JavaScript by Matt Jennings

/*
Add numbers 1 through 4 million inclusive that are
divisible by 3 or 5 but NOT divisible by 3 AND 5
*/
function …

Read more


Using .submit(), return false, and .serialize() with Forms
Posted on June 9, 2015 in jQuery by Matt Jennings

Example code below of what .submit(), return false, and .serialize() in jQuery do when used with forms:

<!DOCTYPE html>
<html>
<head>

Read more