IDrive interview question

Basic questions on JavaScript and Java. Write one code