If the problem is that you obtain 'INCORRECT' if in the dataset exists a record that belongs to the same season but it is not of the same episode BEFORE a record with the two matches, in my opinion you can change the code for:
let obtain=(season,episode)=>
{
var found=false
for (var i of information.embedded.episode)
{
if ( (information.embedded.episode[i].season==season) && (information.embedded.episode[i].number==episode) )
{
found=true;
}
}
if (found==true)
{
alert(info[i].id)
}
else{
alert('incorrect')
}
}
let S=window.prompt('enter the seaseon you wish')
let E=window.prompt('enter the episode you wish')
obtain(S,E)