Instantly share code, notes, and snippets.

View index.html
<script id="jsbin-javascript">
//Challenge 11
//Change every letter of the string to the one that follows it and capitalize the
//Vowels
function letterChanges(str){
let newStr = str.toLowerCase().replace(/[a-z]/gi, function(char)
{
View index.html
<script id="jsbin-javascript">
//Challenge 10 Anagram
//Returns true if anagram is false or not
function isAnagram(str1, str2)
{
return formatStr(str1) === formatStr(str2);
}
View index.html
<script id="jsbin-javascript">
//Challenge 9 Flatten array
//Take an array of arrays and flatten to a single array
function flattenArray(arrays)
{
return arrays.reduce(function(a,b)
{
return a.concat(b);
View index.html
<script id="jsbin-javascript">
//Challenge 8: Array Chunking
//Split an array into chunked arrays of a specific length
//ex. chunkArray
function chunkArray(arr, len)
{
// Init chunked arr
const chunkedArr = [];
View index.html
<script id="jsbin-javascript">
//Challenge 7: The longest Word
//Returns the longest word of a string
//If more than one longest word, put it into an array
//ex. longestword
function longestWord(sen)
{
//Create filtered array
View index.html
<script id="jsbin-javascript">
//Challenge 6: FIZZBUZZ
//Write a program that prints all of the numbers from 1 to 11 in multiples of 3,
//instead of the number, print "fizz", for multiples of 5 print "buzz", for numbers
//Which are mutiples ofboth 3 and 5, print "Fizzbuzz".
function fizzbuzz()
{
View index.html
<script id="jsbin-javascript">
// Challenge 5. Max Character
// Returns a character that is most common in a string
//
function maxCharacter(str)
{
const charMap = {};
let maxNum = 0;
View index.html
<script id="jsbin-javascript">
// Challenge 4. Capitalize letters
// Returns a string with the first letter of every word capitalized
// ex. capitalizeLetters('I love javascript') === 'I love Javascript'
function capitalizeLetters(str)
{
//Takes a lowercase string and splits it
View index.html
<script id="jsbin-javascript">
// Challenge 3: Reverse an Int
// Return an integer in reverse
// ex. reverseInt(521) = 125
function reverseInt(int)
{
//Turns the number into a string than it reverses it
const revString = int.toString().split('').reverse().join('');
View index.html
<script id="jsbin-javascript">
// Challenge 2: Validate a palindrome
//Return true if palindrome and false if not
function isPalindrome(str)
{
const revString = str.split('').reverse().join('');
return revString === str;