for (i in data) json js code example Example: create a json object in javascript var employee = { "firstName": firstName, "lastName": lastName }