The data type of the variable a is determined by the value assigned to it. In JavaScript, if a value is enclosed in double or single quotes, it is treated as a string.
Variable Assignment:
Given the code:
var a = "true";
The value "true" is enclosed in double quotes, making it a string.
Explanation:
Option A: Boolean is incorrect because the value "true" is a string, not a boolean.
Option B: String is correct because the value is enclosed in double quotes.
Option C: Object is incorrect because the value is a primitive string.
Option D: Undefined is incorrect because the variable a is assigned a value.
References:
MDN Web Docs - JavaScript Data Types
W3Schools - JavaScript Data Types
Web-Development-Applications PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 65% Discount on All Products,
Use Coupon: "ac4s65"