equivalent of javascript class using JSON

Posted by brz dot net on Stack Overflow See other posts from Stack Overflow or by brz dot net
Published on 2010-05-28T08:50:58Z Indexed on 2010/05/28 9:01 UTC
Read the original article Hit count: 176

Filed under:
|

See following class:

function availItem(xs, s, m, l, xl) {
            this.xs = xs;
            this.s = s;
            this.m = m;
            this.l = l;
            this.xl = xl;
        }

How can I declare the above class using JSON? I think It should be in following manner but problem is to pass argument.

var availItem = { 
               xs : xs,
                s : s,
                m : m,
                l : l,
                xl : xl


}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about JSON