JSFiddle - React, Tailwind, and code Playground
JavaScript
var video = function() {
if( !(this instanceof video) ){
return new video();
}
this.name = "Name of Video";
this.desc = "Short Description of Video";
this.long = "Long Description of Video";
};
video.prototype.metadata = function(){
return {
name : this.name,
shortDescription : this.desc,
longDescription : this.long
};
};
console.log(video().metadata());
var v = video();
console.log(v.metadata());
var vid = new video();
console.log(vid.metadata());