Simulating race conditions to understand challenges of multithreading (Golang)

I’m writing this post to better understand the challenges of using the multi-threading model of concurrency. I’m using Go to simulate a multi-threaded processing scenario. In Golang the

Asynchronous execution inside for loops (Golang and Nodejs)

The following code is written to highlight the challenge of asynchronous execution inside for loops using code snippets in Golang and Nodejs In Golang

What's in a URL?

How bitwise NOT works in JavaScript?

While writing a blog post on Bitmasks I realized my current mental model of how the NOT operator works is flawed. I expected the NOT operator to flip the...

Using Bitmasks and Binary operations in JavaScript

One of the problems I attempted on HackerRank had an elegant solution using bitmasks. I don’t remember the problem any more, but I do remember struggling with binary calculations in...

What is Web Assembly?

I have been coming across the term ‘Web Assembly’ rather often while browsing HackerNews. I have no idea what it is but from reading off the comments I gather, it’s...

[Reference] JS Conf Talk - Scaling Nodejs beyond ordinary

I recently watched this talk Scaling Nodejs beyond ordinary made by Abhinav Rastogi at JSConf Iceland. The talk is given by the Lead UI Engineer of Flipkart, which is...

Reading Nodejs source code - How fn.call and util.inherits are used to extend Prototypal Chain?

Code var util = require('util'); function Person() { this.firstName

Reading Nodejs source code - Using fn.call to inherit properties and methods from other constructor functions?

Using util.inherits Readable object gets access to all the properties and methods defined on the prototype property of ‘Stream’ function constructor. Node.js source code (lib -> _stream_readable.js)

Reading Nodejs source code - How util.inherits affects the prototypal chain?

How util.inherits works? Node.js source code (lib -> util.js -> exports.inherits) exports.inherits = function(ctor, superCtor)...

Reading Node.js source code - How to?

While taking a course that explained some of the under-the-hood features of Node.js, I attempted to read the source code myself. While I’m a long way from understanding the code,...

What are the different ways to create an object?

Object Literal Syntax var obj = { prop1: 1, prop2: 2, method1

What is Prototypal Inheritance?

When a property or a method of an object is referenced in JavaScript, the JS engine looks for it within the object and along the prototype chain. Now what is...

Difference between == and ===?

=== compares both the data and the type and returns true only if both the data and the type are match == coerces if the data...

Difference between var and let

Code var a = 10; var b; let c = 20; let...

How does Pass by Reference work for objects in JavaScript?

I was learning to implement a Linked List where in I got confused about how objects are passed by reference in JavaScript. Skip to experiment section Problem