JSFiddle - React, Tailwind, and code Playground
JavaScript
// you can name the object by using this
function MyConstructorName() {}
// with this one, the name of the objct is the variable
var varConstructorName = function() {};
console.log( new MyConstructorName() );
console.log( new varConstructorName() );
// I have a function that creates an object
// with the name arguments provided
function createANameSpace(name) {
// how to create a constructor with the specified name?
// I want to return an object
return;
}
// create an aobject with the name provided
var ActorObject = createANameSpace('Actor');
// I want the console to print out
// Actor{}
console.log( ActorObject );