
Swap the order of two words in a string by splitting it into an array, reversing the array, and joining it back using built-in functions.
Learn to swap two words using array indices. Convert the string with split into an array, then return the second element followed by the first to swap the names.
Filter even numbers from an array by building a function that uses a for loop and the modulus operator, returning only evens with examples like 1 through 10.
Learn to remove odd numbers from an array using the filter method and the modulus operator, returning a new array of even numbers.
Repeat a given string N times with a for loop, returning an empty string if N is non-positive, using a final string accumulator and example cases like car and bar.
Repeat a string using a while loop to build the final string by appending the input string while decrementing the counter in JavaScript algorithms.
Learn to find the length of the longest word in a string using regular expressions and the replace method in JavaScript, then split, compare word lengths, and return the result.
Apply a replace with a regex to remove non-word characters, split into words, and use a for-of loop to determine the longest word length.
Master how to filter an array to keep only numbers by using for loops, typeof, and Number.isInteger() method, while excluding strings. See practical examples that yield [2,4,6] and [24,32,7].
Apply the filter method to an array of numbers and strings, returning a new array containing only numbers by checking with typeof or Number.isInteger.
Learn to alphabetize a string by splitting it into characters, sorting with JavaScript's sort method, and joining back to form the alphabetized string.
Learn to alphabetize a string by converting it to an array with the spread operator, sorting the characters, and joining them back into a sorted string.
Learn to reverse a string using built-in functions by splitting the string into characters, reversing the array, and joining it back, with an optional one-line solution.
Reverse a string in one line with the spread operator to split into characters, reverse, and join them, tested with examples; next, a for-loop reverses from back to front.
Learn to reverse a string using a for loop from last to first, without split or join, by building a reverse string and returning it.
Learn to reverse a string by looping with the for of loop, building the reversed result by adding each character to the front and testing with examples.
Explore how to determine if a string is a palindrome by normalizing input, removing non-word characters and spaces, converting to lowercase, reversing, and comparing to the original.
Hi, it's me, Rob - Front End Engineer and online instructor with over 15,000 students.
If you are a beginner JavaScript students wanting to prepare yourself for your first JavaScript coding interview then this course is for you!
An algorithm is like a recipe. It takes “inputs” (the ingredients), and performs a set of simple and (hopefully) well-defined steps, and then finishes after producing an “output” (the meal).
Each lesson will present you with:
An algorithm for you to solve. This is like challenging you as a chef to produce a specific meal.
I will share with you the JavaScript tools that may be helpful to solve this challenge. This is like knowing the ingredients, tools and techniques of cooking.
I will then teach you to write out pseudocode, how you would solve this problem in your own words. This is where we will write out the recipe together.
Finally, I’ll present you with multiple ways to solve each challenge. Just like there are variations in how to make a meal, so there are a number of ways to solve an algorithm.
Check out any of the sample videos for this course to get a feel :)
Many algorithm courses will present you with a challenge then have you passively watch them solve the challenge. This course will guide you as a beginning in breaking down a problem and learning to solve on your own.
This isn’t the only algorithms course you should ever take. But it should be your first!
Let’s get cooking with JavaScript!