Skip to content

Instantly share code, notes, and snippets.

View danneamtu's full-sized avatar
🚀
Coding, learning, creating

Dan Neamtu danneamtu

🚀
Coding, learning, creating
View GitHub Profile
function factoryFunction(name){
// closure
let _name = name;
return {
name: _name,
info(){
return 'Some info';
}
// Create object
const user = new Object();
// Add properties and methods
user.name = 'Alex';
user.info = function() {
return 'Some info';
}
const user = new Object();
user.name = 'Alex';
user.info = function() {
return 'Some info';
}
const user = {
name: 'Alex',
info(){
return 'Some info';
}
}