JavaScript based Data-Structures and Algorithms to be used for learning and researching purposes only. Here I had used Unit test, Code coverage and also at future I will setup snapshot test. This project environment support both TS and JS base test.
A Queue is a linear structure that follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
A good example of a queue would simply be a line at a grocery store. The customer in line (queue) first, will leave first.
Write a function that returns the number of vowels in a string.
Here we have two solutions, one makes use of a regular expression, and another uses an iterative approach, a for-of loop.
Stack data structure
A stack is a linear data structure that follows the principle of Last In First Out (LIFO).
This means the last element inserted inside the stack is removed first ๐ฅ๐ฅ๐ฅ.
You can think of the stack data structure as a pile of plates on top of another.
Here's a JavaScript implementation of a stack data structure ๐
Reverse a string. It's a common interview question, and it's quite simple. However, if you really want to impress your interviewer, you'd be well-off to understand multiple solutions to the problem. Rather than using built-in methods like ".reverse()" (which is fine, but you may be asked to neglect using it), demonstrate your ability to solve it in different ways.
Here are three solutions to reversing a string in JavaScript.
If you want to make your development life easier, familiarize yourself with these string and array methods. ๐
Learn them inside-out. Try running them on your machine right now to see the behavior of each of them. ๐
Let us know what you think about these built-in methods down below. Want to increase your JavaScript skills?
Here are three interview questions commonly asked to junior developers. They're quite simple, but can be tricky if it's the first time you've encountered them.