Skip to content

Instantly share code, notes, and snippets.

View elenaparaschiv's full-sized avatar

Elena Paraschiv elenaparaschiv

  • Stockholm, Sweden
View GitHub Profile

Keybase proof

I hereby claim:

  • I am elenaparaschiv on github.
  • I am justelena (https://keybase.io/justelena) on keybase.
  • I have a public key ASC4SzYEbofqg8C9kk2awoo4r7Gu5HSAxjK6gdedxVFqOAo

To claim this, I am signing this object:

@elenaparaschiv
elenaparaschiv / constructorsDef.js
Created July 1, 2017 14:10
simple defition of constructors
function Dog(name){
this.name = name;
this.fetch = function(){}
}
var myDog = new Dog('Bobby');
// when myDog will be called it will get the prototype of the Dog constructor
(function(){
var libraryStorage = {};
var dependenciesGathered = [];
function librarySystem(libraryName, dependencies, callback){
if(arguments.length > 1){
dependencies.forEach(function(dep){
dependenciesGathered.push(libraryStorage[dep]);
});
libraryStorage[libraryName] = callback.apply(this, dependenciesGathered);
}else{
function runWithDebugger(callback, optionalArguments){
debugger;
callback.apply(this, optionalArguments);
}
function sayFullName(first, last) {
console.log( "Hi " + first + " "+ last);
}
// expected result ---> 'Hi Elena Paraschiv'