push values to array by key in javascript code example Example: javascript push array with key name arr["key"] = "value";