In the very first iteration when this function is invoked, the state object will be empty. The if condition checks this and initializes the temperature with a default value of 50. Since state is preserved across iterations, the temperature value will be set to 51 in the next iteration and it will keep getting incremented by 1 with each subsequent iteration. At the end of each iteration, the function simply stringifies the JSON object and return the string as a payload. Here is what the first payload sent from this function will look like: