contracts-js
Version:
A contract library for JavaScript
17 lines (14 loc) • 401 B
JavaScript
import @ from "contracts.js"
// If you're running this particular example in
// Chrome you'll need to enable harmony features first
// by going to chrome://flags/#enable-javascript-harmony
// Firefox works out of the box.
function makePerson(name, age) {
return {
name: name,
age: age
};
}
var o = makePerson("Bob", 42);
o.age = "100";