OneTrust interview question

Basic js hacker rank question