Report Bug

QusWhich of the following variable name is valid in JavaScript? QusJavaScript में इनमें से कौन-सा वेरिएबल नाम मान्य है?


A. 2value
B. first-name
C. var
D. _totalAmount


Solution
D. _totalAmount



Explanation
<div><span style="font-size: 14px;">In JavaScript, a valid variable name must follow these rules:</span></div><div><span style="font-size: 14px;"><br></span></div><ul><li><span style="font-size: 14px;">It must start with a letter (A–Z, a–z), underscore (_), or dollar sign ($).</span></li><li><span style="font-size: 14px;">It cannot start with a number.</span></li><li><span style="font-size: 14px;">It cannot contain hyphens (-).</span></li><li><span style="font-size: 14px;">It cannot be a reserved keyword such as var, if, for, etc.</span></li></ul>
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad