Toncho Dev

Front-End Web Development

Sharing knowledge to make the web an amazing place.

👀 Sign up for email newsletter or use this RSS feed to get notified of new blog posts!🔥

Javascript Object literal conditional properties

We constantly coming up against adding conditional properties to an Object, we are going to use the spread operator and the short-circuit evaluation to deal with it an elegant way.

Javascript Array of Unique Values

Handling array duplicates can be tricky. There are multiple ways to remove duplicates from an array, we are going to take a look of Set constructor and a couple of implementatios of indexOf(), filter(), and forEach() methods.

Javascript Replace All Occurrences of a String

How to replace all ocurrences of a string in Javascript? Lets see 2 easy ways with replace() and split() with join() methods

Nodejs Reading Files

The easiest way to read a file in Node is to use the `fs.readFile()` function to asynchronously reads the entire contents of a file. Alternatively, you can use the synchronous version `fs.readFileSync()`

Express Serving Static Files

It's common to have images, css, js and more assets in a `public` folder, and expose them to the root level. To do that we just simple use the `express.static` built-in middleware function in Express `static` of express

Express Security

Security is really hard to get right. There are so many different factors to consider, countless different ways to break an application. As a Node.js developer, you most work with a huge amount of user data, probably some of them being very sensitive.

Javascript Clean Code

A professional developer will write the code thinking about your later self, for your 'co-workers' or just 'the other guy' and not just for the machine. If you worry about how the code it is written and not only if it work or not then you care about the clean code

List of 28 Javascript Arrays Methods you should know

Arrays in Javascript provide a lot of methods. To make things easier, I will share a useful list with 28 JavaScript Array methods you should know.

Javascript Basic of Array

Arrays in JavaScript are high-level list-like objects with a length property and integer properties as indexes.

Basic Express Server with Node.js

A short guide of the Express framework with Node.js to create a basic server, that allows you to spin up robust APIs and web servers in an easy and clean way.