Skip to content

Instantly share code, notes, and snippets.

@gitmathub
gitmathub / js-parameters.md
Last active April 4, 2019 07:54
Parameter Mutants

Mutate Parameters

It's common practice to mutate the parameters in JS. But there are some good reasons not do to. And ways how to do it better.

Docs

Call By Sharing

Javascript passes object to a function by Call by sharing. Can be said to pass by copy of reference.

@brunobraga95
brunobraga95 / copyFirestoreDB.js
Last active August 12, 2021 14:35
Copy firestore database
const firebase = require('firebase-admin');
var serviceAccountSource = require("./source.json"); // source DB key
var serviceAccountDestination = require("./destination.json"); // destiny DB key
const sourceAdmin = firebase.initializeApp({
credential: firebase.credential.cert(serviceAccountSource)
});
const destinyAdmin = firebase.initializeApp({