Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
ans: const
Q1- How can a datatype be declared to be a constant type?
1-const
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
ans 1.const
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
Ans :- const
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
const
Q2- What will be the output of the following code snippet?
<script type="text/javascript">
a = 5 + "9";
document.write(a);
</script>
1-Compilation Error
2-14
3-Runtime Error
4-59
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
ans-const
Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
Ans: const
1-const
Once a variable is declared with `constits value cannot be reassigned or changed throughout the code It remains constant during the entire execution of the program
Const
Const data type can’t be changeble it’s fixed type data
Ans :- 59
<script type="text/javascript">
a = 5 + "9";
document.write(a);
</script>
1-Compilation Error
2-14
3-Runtime Error
4-59
ans:59
Q2- What will be the output of the following code snippet?
<script type="text/javascript">
a = 5 + "9";
document.write(a);
</script>
1-Compilation Error
2-14
3-Runtime Error
4-59
compilation error
ans- 59
59
The output of the following code snippet will be:
59
Q3-What will be the output of the following code snippet?
<script type="text/javascript" language="javascript">
var a = "Scaler";
var result = a.substring(2, 4);
document.write(result);
</script>
1-al
2-ale
3-cal
4-caler
Q2- What will be the output of the following code snippet?
<script type="text/javascript">
a = 5 + "9";
document.write(a);
</script>
1-Compilation Error
2-14
3-Runtime Error
4-59
[/quote]
ans 4.59