PrepAway - Latest Free Exam Questions & Answers

What will the alert(WL.Client.getUserPref(‘key1’)); show?

Given the following code:

What will the alert(WL.Client.getUserPref(‘key1’)); show?

PrepAway - Latest Free Exam Questions & Answers

A.
The alert will not show since WL.Client.setUserPref cannot be called in the for loop since it is
an asynchronous function.

B.
updatedValue1 since WL.Client.setUserPref({‘key1’ : ‘updatedValue1’}); will replace the value of
key1 set in the for loop.

C.
value1, updatedValue1 or null since WL.Client.setUserPref is an asynchronous function and
there is no guarantee which call, if any,will return first.

D.
value1 since WL.Client.setUserPref(‘key1’, ‘updatedValue1’); will fail because
WL.Client.deleteUserPref(‘key1’) was notcalled before setting the new value.

Explanation:


Leave a Reply