Here’s another fun code challenge from Coderbyte: Using the JavaScript language, have the function SimpleMode(arr) take the array of numbers stored in arr and return the number that appears most frequently (the mode). For example: if arr contains [10, 4, 5, 2, 4] the output should be 4. If there is more than one mode […]

## Code Challenge: Greatest Common Factor

This week’s JavaScript code challenge again comes from Coderbyte: Using the JavaScript language, have the function Division(num1,num2) take both parameters being passed and return the Greatest Common Factor. That is, return the greatest number that evenly goes into both numbers with no remainder. For example: 12 and 16 both are divisible by 1, 2, and […]

## Code Challenge: Triple Double

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. Again, this week’s code challenge comes from my trusty favorite, Coderbyte: Using the JavaScript language, have the function TripleDouble(num1,num2) take both parameters being passed, and return 1 if there is a straight triple of a number at any place […]

## Code Challenge: Consecutive

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. This week’s code challenge comes again from Coderbyte: Using the JavaScript language, have the function Consecutive(arr) take the array of integers stored in arr and return the minimum number of integers needed to make the contents of arr consecutive […]

## Code Challenge: Additive Persistence

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. First, I’ll admit that I’m a day overdue on this code challenge. Last week, I was on vacation in Austin, TX, and I’m still playing catchup. Still, that’s no excuse! After being away for a week, I felt a […]

## Code Challenge: Number Search

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. This week’s code challenge again comes from Coderbyte. It’s quite a bit easier and shorter than last week mainly because I was slammed with Drink for Pink events and prepping for the Automattic Grand Meetup! Here’s the gist: Using the […]

## Code Challenge: Blackjack

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. This week’s challenge comes from Coderbyte, which has been a fun resource. The instructions are a bit of a doozy: Have the function BlackjackHighest(strArr) take the strArr parameter being passed which will be an array of numbers and letters representing […]

## Code Challenge: String Reduction

Each week, I offer up a JavaScript code challenge. Want more? You can find others here. This week’s code challenge comes from Coderbyte. Here are the basic instructions: Have the function `StringReduction(str)` take the `str` parameter being passed and return the smallest number you can get through the following reduction method. The method is: Only […]

## Code Challenge: Recurring Letters

This is the fourth post in a series of at least 10 JavaScript code challenges. You can find the others here. This one was a bit of a doozy! I originally read this challenge three weeks ago and gave it a try. I couldn’t get it working so I moved on to another after an hour […]

## Code Challenge: Reverse, Reverse!

This is the third post in a series of at least 10 code challenges. You can find the others here. Compared to the previous two challenges, today’s challenge was short and straightforward. Challenge: Given a string, the function reverseString should return the same string backwards. For example, reverseString(“This string”) would return “gnirts siht.” When writing your function, assume the […]