files/en-us/web/api/speechrecognitionevent/results/index.md
{{APIRef("Web Speech API")}}
The results read-only property of the
{{domxref("SpeechRecognitionEvent")}} interface returns a
{{domxref("SpeechRecognitionResultList")}} object representing all the speech
recognition results for the current session.
Specifically this object will contain all final results that have been returned, followed by the current best hypothesis for all interim results. When subsequent {{domxref("SpeechRecognition.result_event", "result")}} events are fired, interim results may be overwritten by a newer interim result or by a final result — they may even be removed, if they are at the end of the "results" array and the array length decreases. Final results on the other hand will not be overwritten or removed.
A {{domxref("SpeechRecognitionResultList")}} object.
This code is excerpted from our Speech color changer example.
recognition.onresult = (event) => {
const color = event.results[0][0].transcript;
diagnostic.textContent = `Result received: ${color}.`;
bg.style.backgroundColor = color;
};
{{Specifications}}
{{Compat}}