Daily problems that I do and my solutions in Javascript
Problems may come from various textbooks, leetcode, and interesting questions from sites like reddit or quora.
queryToObject.js
because I had to use decodeURIComponent()pascalTriangle.js
because I used slice with negative number e.g. array.slice(-2). Might be useful for getting specific number of values at the end in the future.stripURL.js
because I had to use new Map() instead of using regular object. Map retains order; regular objects do not.solomonDistanceGame.js
because instead of using if-else or switch, I utilized nested ternary operators.highLow.js
because while it was an easy problem, I utilized .sort() with a callback and used ES6 string template literaltrackCharString.js
because I used regex and String.prototype.match() to track of desired charactersunderscoreDefaults.js
because I used Array.prototype.slice.call() and arguments. Also, should use undefined as a filter instead of !, because falseys such as 0 passes the ! test.