Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Rohan Chougule rchougule

💻
View GitHub Profile
@rchougule
rchougule / asyncWaterfall.js
Created Sep 28, 2020
Async Waterfall in JavaScript
View asyncWaterfall.js
function selectMovie(input, callback) {
const output = `Movie Selected: ${input} ->`;
callback(null, output);
}
function bookTicket(input, callback) {
const output = `${input}, Ticket ID: 1234 ->`;
callback(null, output);
}
View transpileToES5.js
"use strict";
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
@rchougule
rchougule / copyByReference.js
Created Apr 11, 2020
Copying an Object in Node.js is by default via Reference
View copyByReference.js
const sports = {
default: false
};
const copySports = sports;
copySports.default = true;
console.log(sports);
//OUTPUT