Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Code A: var x = 10; y = --x + 1;
Home
JavaScript
Code A: var x = 10; y = --x + 1;
+1
vote
asked
Feb 6, 2020
in
JavaScript
by
rajeshsharma
Code A: var x = 10; y = --x + 1;
alert(y);
Code B: var x = 10;
y = x-- + 1;
alert(y);
What is the output for code A and B?
10,11
10,10
11,10
11,11
#javascript-code
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Feb 7, 2020
by
SakshiSharma
10,11
Related questions
+1
vote
Q: Can Javascript Code Be Broken In Different Lines?
asked
Dec 4, 2019
in
JavaScript
by
SakshiSharma
#javascript-code
0
votes
Q: The following code implements the ______ feature of ES6 function myFunction(x, y, z) { } var args = [0, 1, 2]; myFunction(...args);
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
0
votes
Q: var i = 1; if (function f(){}) { i += typeof f; } x;
asked
Feb 6, 2020
in
JavaScript
by
rajeshsharma
#function-value
0
votes
Q: What's the output? const box = { x: 10, y: 20 }; Object.freeze(box); const shape = box; shape.x = 100;
asked
Mar 11
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? (() => { let x = (y = 10); })();
asked
Mar 9
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? [1, 2, 3, 4].reduce((x, y) => console.log(x, y));
asked
Mar 10
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: " var jarvis = function (x: number, y?: number): number {} " showcases _________.
asked
Jan 27, 2020
in
TypeScript - JavaScript's Superset
by
AdilsonLima
typescript
typescript-frescoplay
javascript-interview-questions
typescript-programming-questions
typescript-practice-problems
typescript-interview-questions-github
typescript-tutorial
typescript-quiz
angular-interview-questions
typescript-interview-questions-and-answers-2022
0
votes
Q: What if we put ++ operator inside if condition? find the output of below code <script> var a = 10; if(a == a++) document.write(a); </script>
asked
Oct 9, 2022
in
JavaScript
by
Robin
javascript
code
0
votes
Q: Consider the code snippet given below var count = [1,,3];
asked
Oct 8, 2022
in
JavaScript
by
rajeshsharma
code-snippet
javascript
0
votes
Q: Evaluate the following Java expression, if x=3, y=5, and z=10:
asked
Apr 8, 2021
in
JAVA
by
SakshiSharma
java
java-questions-and-answers
java-mcq
core-java-mcq
java-multiple-choice-questions
java-questions-2021
java-interview-questions
java-advanced-questions
Java-questions-answers
...