Tech Mahindra interview question

JavaScript