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
}
I want to use both in same manner like
var obj =new availItem(xs,s,b,l,xl);