parameters - Using named arguments in Javascript with regular expressions as names of arguments -



parameters - Using named arguments in Javascript with regular expressions as names of arguments -

is possible utilize named arguments in java or javascript regular expressions names of arguments? want create possible phone call function this:

f("function name:", "drawcircle", "radius:" 1, "xpos:" 0, "ypos:", 0, "color:", "red");

or this, same effect:

f("name of function:", "draw circle", "y position:", 0, "color:", "red", "rad:" 1, "x location:" 0);

both of these should equivalent foo(1, 0, 0, red).

in both cases, arguments given should match list of regular expressions. should possible list arguments , function name in order same result.

is there way implement this?

f({ "name": "drawcircle", "radius": 1, "xpos": 0, "ypos": 0, "color": "red" });

this why utilize objects in javascript.

although want

drawcircle({ radius: 0, x: 0, y: 0, color: "red" });

javascript parameters arguments named

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -