IDrive Interview Question

Basic questions on JavaScript and Java. Write one code