Coderslang: Become a Software Engineer

  • Hey there 馃憢. If you want to learn to code, you’re in the right place.
  • To start learning from scratch I suggest the Full Stack JavaScript course
  • To improve your skills and prepare for the tech interview - a mobile app for iOS or Android
  • Below, you’ll find the links to contact me. And further, a list of interesting programming notes/articles. Feel free to send me a short message on Twitter, Telegram or a plain old email.
  • If you like to get a weekly newsletter with the latest programming tips and tricks, you can subscribe to it here. And get free programming ebooks.
  • Let’s go 馃殌 !

How to remove the last n characters from a JavaScript string

Before you make another step, remember, that strings in JavaScript are immutable. This means that you can鈥檛 alter the string by removing something from it. So, when you want to remove the last n symbols from a string in JS, your only option is to create a new string that wouldn鈥檛 have these n characters....

January 24, 2022 路 2 min 路 Coderslang Master

How to generate a random string in JavaScript

To generate a random string in JS you should start by defining the set of characters that will be used to generate that random string. Let鈥檚 go! ...

January 23, 2022 路 2 min 路 Coderslang Master

Set default parameter values for JavaScript functions

You can add different default values to your JavaScript functions with a simple trick. Let鈥檚 see how it works. ...

January 22, 2022 路 1 min 路 Coderslang Master

How to encode a URL in JavaScript

You can use built-in JavaScript functions encodeURIComponent(str), encodeURI(str) or escape(str) to encode your URLs. Here鈥檚 how you can use it. const urlParam = 'https://google.com'; const encodedURL = "https://coderslang.com?ref=" + encodeURIComponent(urlParam); console....

January 21, 2022 路 1 min 路 Coderslang Master

How to get current date in JavaScript

There are 2 ways you can get current date in JavaScript. You can just create a new Date object without any arguments, or you can use the function Date.now. ...

January 20, 2022 路 1 min 路 Coderslang Master

How to access command-line arguments in Node.js

In Node.js the command-line arguments are captured in the object process.argv. Let鈥檚 start by logging them to the screen. console.log(process.argv); If you run your script without any arguments, the output will be something like this....

January 19, 2022 路 1 min 路 Coderslang Master

How to append something to a JavaScript array

You can append new values to a JS array using the function Array.push. It adds new values to the end of the JavaScript array. ...

January 18, 2022 路 1 min 路 Coderslang Master

How to Format a JavaScript Date

You can format the date in JS by using the toLocaleDateString function. It accepts a locale and returns a string with formatted date. Let鈥檚 try to use the locale en-US....

January 17, 2022 路 1 min 路 Coderslang Master

How to implement sleep function in JavaScript

JavaScript is asynchronous by design, so implementing a sleep function can be tricky. The closest you can get to pausing execution for some time is by using Promise and await....

January 17, 2022 路 1 min 路 Coderslang Master

How to create a multiline string in JavaScript

The easiest way to create a multiline string in JavaScript are backticks. const s = `I'm a multiline string`; console.log(s); The console output shows every word in the string s on a new line....

January 16, 2022 路 1 min 路 Coderslang Master