Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Examples of how to use strict-object
// Create a new person type
var Person = StrictObject.define('name', 'age', 'country');
// Instatiate a Person
var pete = new Person();
// set properties using functions'Peter');
// get properties using functions
// property setters return the target object and are thus chainable'Peter')
// retrieve the properties as an object
console.log(pete._toObject()); // {name: 'Peter', age: 26, country: 'Uzbekistan'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment