Skip to main content

Posts

Showing posts from September, 2017

How to reverse a string in less than four lines of code | javascript

Today I was solving my first algorithm challenge at FreeCodeCamp and I managed to solve from MDN web docs . Here is the script: function reverseString(str) {   var str = str.split('').reverse().join('');   return str; } reverseString("hello"); to preserve non-BMP codepoints mixed with unicode code points (emoji, etc). read here  Link P.S: don't try to do this while your variables are declared as const it won't work :)

how to install a small light weight live server on VS code

we all liked this product from microsoft, and if you don't you might consider giving it a chance, and when you sometimes wake up too lazy you just wanna hit few buttons to start working on  your web related project, here's your best bet: first of fire up that shiny VS code that you've installed now go all the way to the left to that rectangle or ctrl+shift+x for short in the searchbar type live server      choose the one you like, for me I choose the one from Ritwick dey install it and you should see something that looks similar to this      read the instructions or just open the html file you want as you usually do, and go all the way down right and click go live. now you're good to go.