gpt-3.5-turbo-0301· openai
WildChat-4.8M
Create a function called "obterMajorElemento" that takes an array of numbers as a…
- User
Create a function called "obterMajorElemento" that takes an array of numbers as a parameter and returns the largest element of the array.
- Assistant
function obterMajorElemento(array) { let maior = array[0]; for (let i = 1; i < array.length; i++) { if (array[i] > maior) { maior = array[i]; } } return maior; }
- User
Create a function called "obterMajorElemento" that takes an array of numbers as a parameter and returns the largest element of the array.
- Assistant
function obterMajorElemento(array) { let maior = array[0]; for (let i = 1; i < array.length; i++) { if (array[i] > maior) { maior = array[i]; } } return maior; }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.