1.

Which of the following is invoked when it is not fired on window object?(a) removeItem()(b) clear()(c) setItem()(d) getItem()I got this question during an interview.My doubt is from Web Storage topic in chapter HTML Markup, Forms, Video, Audio & Other Multimedia of HTML

Answer»

Right CHOICE is (d) getItem()

To explain I would say: When removeItem(), CLEAR() and setItem() are INVOKED the events are fired on window object, which accesses newly stored or removed data, as DEFINED by LOCALSTORAGE and sessionStorage attributes, getItem(key) method returns the current value associated with the key.



Discussion

No Comment Found

Related InterviewSolutions