Druva interview question

write a polyfill for usestate in js