Developing ASP.NET MVC Web Applications — Question 170

You develop a new ASP.NET MVC application. You use local storage to maintain state.
The localStorage object's setItem method is failing to store a value.
Which two scenarios will cause the failure? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

Answer options

Correct answer: B, C

Explanation

Option B is incorrect because JavaScript arrays can be converted to strings and stored in local storage. Option C is correct since attempting to use the new Value property before setItem would result in a failure. Option A is not valid because local storage being disabled would not relate to the specific use of the setItem method, while D is also not applicable as local storage does not have a strict 10MB limit in all browsers.