object["set" + $fieldID]($fieldValue);
Some reading material for the above: Member Operators on MDC.
Some advanced methods include
Function.prototype.apply. The first is somehow equivalent to PHP's
call_user_func() while the latter is somehow equivalent to PHP's
An equivalent for the above example, but using
apply() looks like this:
object["set" + $fieldID].call(object, $fieldValue);
object["set" + $fieldID].apply(object, [$fieldValue]);
The first argument must be
object otherwise the method will be executed with the
this pointer bound to the global object,
window in the case of browsers.