EPAM Systems interview question

related to hoisting concept in javascript, closures, in react native hooks related.