var global; function getResult() { getParams(["Param1", "Param2"], function (res) { global = res; });