Fix MongoError on first connect

The default MongoDb port is 27017. An error occurs sometimes while I am running my Node & ExpressJS application, with the message: message: ‘failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]’ } Several solutions are provided on the internet to fix this. But a lot of them did not work … Read More

Template literals

I have to print a message with values of, say, two variables interpolated or inserted in it. I am talking about JavaScript here. What I do is start single or double quotes, write some part of my message string, close the quotes, insert the variable, start quotes for remaining part of the message and keep … Read More

Some methods of arrays

Iteration of arrays can be done via use of a map function instead of using for loops. Given an array, each element of the array is operated upon. Function creates a new array instead of updating the existing one. // Multiply each element of oldArray with 3 to create a newArray var newArray = oldArray.map(function(val) … Read More

Objects in JS

Objects in JS can be created by: Use of variables Use of functions // table variable | // use of function var table = { | var table = function() { “legs”:4, | this.legs = 4; “color”:”brown”, | this.color = “brown”; “material”:”wood” | this.material = “wood”; }; | }; An instance of these objects can … Read More

Hour 2 : JS

Continuing learned using boolean values, conditional statements, switch case and use of functions. Everything goes on like we might have learned in some other language. Encountered only a new operator category called the strict equality operator and strict inequality operator. Strict equality operator uses === instead of the normal == for the equality operator. So … Read More

Hour 1 : JS

Having not used JS even to a novice level, I had planned to learn it and create something substantial. And today was the first day to executing the plan. I will brief out the things I learned in the sequence on a map. undefined, null, boolean, string, number, symbol and object are the 7 data … Read More

(Im)Mutable

Mutable and immutable are common English words. Something that can be changed is mutable and that cannot be is immutable. I came across these few years ago but it was an over-head-flow then. There are two classes in Java String and StringBuilder and both suffice almost the same purpose with some additional features in the … Read More

Why is reading so important?

Why is reading so important?
Why is reading so important? by Dushka ZapataAnswer by Dushka Zapata: Imagine a room within four brick walls.It’s comfortable and you have what you need. But it has no windows.This room is an ordinary life. Acceptable, but limited. Reading is like creating a window.A window means a breeze. It means light, and the sun shining … Read More
Follow

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: