## Javascript Steps Problem

The goal of this problem is to take in a number (example – 4, and then print out that number of steps).  There must be a space to pad out the rest of the character.  Ex. n=4; loop 1 will be one # and three spaces for a total of 4 characters:

I’m still […]

## Javascript Capitalize First Letter in Every Word Problem

In this problem, I am taking in a string and capitalizing the first letter of every word.  Here I use a for…of loop.  First I use the split() method to convert the string into an array and take the first letter of every word and capitalize it.  Then I use the slice() method to add […]

## Javascript Regular Expressions (regexp)

Javascript regular expressions (regexp) are very useful methods for string manipulation — match, replace, search and split.  I also find them pretty confusing.  In the previous post on the Javascript anagram problem, I used the following regexp to remove all punctuation, etc. from a string: str.replace(/[^\w]/g,”).  What does this actually mean?  It’s hard to decipher a […]

## Auto Binding in React / ES6

I was working on a project for my web design course in late 2017, a website for newbie investors to track and learn about cryptocurrencies.  I developed the site in React, so I had to use Javascript ES6 syntax.  I have a method in my App component that would read in the current price of […]

## Javascript Anagram Problem

This is the anagram problem I reviewed using Stephen Grider’s interview prep on Udemy. Amagram: a word, phrase or name formed by rearranging the letters of another, such as cinema from iceman (Google Dictionary). The challenge is to compare two sets of words or phrases to see if they contain the same number of each letter. Option 1 – […]

## Javascript Chunking Problem

I worked this problem a couple of ways from both Stephen Grider’s Udemy Course and Traversy Media’s YouTube course. Below is solution 1.  I use a for…of loop.  First I determine what position the last element of the array would be (const last = chunked[chunked.length-1]).  I have to use chunked.length-1, because length counts the number […]

## Javascript FizzBuzz problem

This is the classic Javascript FizzBuzz problem where the task is to loop through n numbers and print “fizz” for multiples of 3, “buzz” for multiples of 5 and “fizzbuzz” for multiples of 3 and 5 (i.e. 15). This is a rather simple problem.  The main thing is to test your knowledge of the modulo […]

## Javascript Reversed Integer Problem

Doing the Javascript reversed integer problem is pretty straightforward after doing the reversed string problem.  The only extra steps are to convert the number into a string “.toString()”, then an array “.split(”) and “.reverse()” to reverse it.  Finally, I need to use “.join(”) to convert it from an array back into a string, and “parseInt()” to […]

## Javascript Palindrome Problem

Here are a few solutions to the palindrome problem (a palindrome is a word that is the same spelled backward or forwards — like “racecar.” The objective is simply to return true if the word is a palindrome or false if it is not a palindrome. The solutions to this are pretty simple.  I just […]

## More Solutions to Javascript Reverse String Problem

I just started the Udemy course “The Coding Interview Bootcamp” by Stephen Grider.  I have five solutions below for the reverse string problem in Javascript.  The first three solutions I was already comfortable with.  I never actually used the for…of loop, however.  Grider recommends using it when possible in interviews as there is less room for […]