The comma operator evaluates each operand and then returns the value of the last one.
You'd need to either return an array:
return [h, w];
...or an object:
return { h : h, w : w };
Which you'd then use as:
var test = test();
alert(test[0]); // "hello" - in the case of the array version
...or:
var test = test();
alert(test.w); // "world" in the case of the object version