JSFiddle - React, Tailwind, and code Playground

by TeslaNick

JavaScript

YUI.add("phone", function(Y) {

    Y.Phone = Y.Base.create('phone', Y.Base, [], {
        property: function() {
            return 'hello instance';
        }

    }, {
        PROPERTY: "hello world",
        // constructor-level property
        ATTRS: {
            'areacode': {},
            'number': {},
            'extension': {}
        }
    });
}, '', { requires: [ 'base-build' ] });

YUI().use('phone', function(Y) {

    var myPhone = new Y.Phone();

    document.write(myPhone.property()); // call instance method
    document.write('<br />');
    document.write(Y.Phone.PROPERTY); // get constructor property
});