by Charles Lueker

JavaScript is the language that makes things happen. It does this using functions. Harken back to your high school algebra days. Each section below utilizes a function that does something specific when you click "Run". Play around and see what happens.

Function #1

This function takes a string (tech talk for a sequence of characters: letters/ numbers/ spaces/ etc...) and checks to make sure that the string has a length of exactly three characters. It returns "true" if the string length is three or "false" if it is not three.

Example:
typing "run" will give you "true", but "no" will give you "false"

Function #2

This function takes two sets (aka arrays[]) of integers, "a" and "b", and returns a new array[] joining the elements of array "a" followed by the elements of array "b".

Enter any inputs you'd like, but make sure to separate each item with a comma.
Array a
Array b

Function #3

Proper nouns always begin with a capital letter followed by lower case letters. This function takes a potentially improperly capitalized proper noun and returns the same noun with the proper capitalization.

Function #4

This function takes a string and returns the letters in alphabetical order by upper and lower case.

ex. My Home = HMemoy

Function #5

Here I've written a function from scratch that returns the absolute value of a given integer without the use of the special JavaScript method called Math.abs(...).

Function #6

This function returns the smaller of two numbers.

Enter any two numbers below.



Function #7

This function maps a given integer to a month.

For example:
entering 1 and pressing "Run" will give you "January"

Enter a number between 1 and 12 inclusive.

Function #8

Here, a function returns the sum of squares of all integers from 1 up to and including a given positive, non-zero integer N.

Enter your number here.

Function #9

This function finds the max difference between any two adjacent numbers.

Enter a list of numbers and separate them by commas.

Function #10

This function transforms a given sentence into a new one with dashes between each two consecutive characters while it ignores spaces.

For example:
insertDashes('abba test') => a-b-b-a t-e-s-t

Write a short sentence here.

Function #11

This function outputs the substring of a given string within specified bounds without using the JavaScript method String.substring().

Please note, when counting in JavaScript, we often start with 0 instead of 1. That is the case here.

For example:
'abcde', 2, 3 = 'cd'



Function #12

This one swaps two halves of a given array[]. If the array has an odd number of elements, the array will be split in half by rounding down the number of elements divided by two.

For example:
[1,2,3,4,5] will equal = [3,4,5,1,2]

Function #13

For a given n and k, this function returns the count of the number of multiples of k that are not greater than n.

For example:
Entering 4 and 1 will = 3 because 1*2, 1*3 and 1*4 are not greater than 4.

Input number "n"
Input number "k"