Interview practice mcq

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

1 Like

Q1- How can a datatype be declared to be a constant type?
1-const

1 Like

Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant

ans 1.const

1 Like

Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant

Ans :- const

1 Like

Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant

const

1 Like

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

1 Like

Q1- How can a datatype be declared to be a constant type?
1-const
2-var
3-let
4-constant
Ans: const

1 Like

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

1 Like

Const
Const data type can’t be changeble it’s fixed type data

1 Like
Ans :- 59
1 Like

<script type="text/javascript">
a = 5 + "9";
document.write(a);
</script>
1-Compilation Error
2-14
3-Runtime Error
4-59
ans:59






1 Like

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

1 Like

ans- 59

1 Like

59

1 Like

The output of the following code snippet will be:
59

1 Like

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

1 Like
var a = "Scaler"; var result = a.substring(2, 4); document.write(result); ans:al
1 Like