PrepAway - Latest Free Exam Questions & Answers

Which line of code should you use?

You have the following code:

You need to convert objStr into an array.
Which line of code should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
var jsObject = Array.bind(objStr);

B.
var jsObject = Array.valueOf(objStr);

C.
var jsObject = JSON.parse(objStr);

D.
var jsObject = $.makeArray(objStr);

Explanation:
https://www.w3schools.com/js/js_json_parse.asp

One Comment on “Which line of code should you use?


Leave a Reply