Skip to content

Instantly share code, notes, and snippets.

Avatar

Elena Paraschiv elenaparaschiv

  • Stockholm, Sweden
View GitHub Profile
View keybase.md

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 Jul 1, 2017
simple defition of constructors
View constructorsDef.js
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
View librarySystem.js
(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{
View runDebugger.js
function runWithDebugger(callback, optionalArguments){
debugger;
callback.apply(this, optionalArguments);
}
function sayFullName(first, last) {
console.log( "Hi " + first + " "+ last);
}
// expected result ---> 'Hi Elena Paraschiv'