equivalent of javascript class using JSON
- by brz dot net
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
}