Secure coding 101: javascript | Skill Assessment

Hi everyone,
I’m on the “Secure coding 101: javascript”
Could someone practice with me to work out SA questions?

hi, I am doing the assesment. trying to get the second question done

anyone got question 2, i feel kinda lost i must miss something any help would be appreciated