Object types in JS.
Berbagai jenis obyek di JS.
let object = {
property1: prop1,
property2: prop2,
method1: meth1,
method2: meth2
}
function objectNew(params){
let object = {};
object.properties = params;
object.methods = function;
return object;
}
- https://github.com/dwi-handoyo/Objects-in-Javascript/blob/main/2-functionDeclaration.js
function objectNew(params){
this.properties = params;
this.methods = function;
}
const objectMethod = {
method: method;
}
function objectNew(params){
let object = Object.create(objectMethod);
//property
object.param = param
return object;
}
function Object(params){
this.properties = params;
}
Object.prototype.method
Class Object{
constructor(params){
this.properties = params;
}
function (params){
return value;
}
}
let obj = Object(params)
const Obect = function(parameters){
this.properties = parameters;
this.method = function(){
return value;
}
}
let obj = new Object(parameters);