IT quiz
All questions
Sign in
Sign up
JavaScript
HTML
CSS
PostgreSQL
PHP
Linux
Git
Docker
SCSS
TypeScript
SQL
Vue
DNS
Go
frontend (web)
Redis
backend
Gitlab
CI/CD
Vite
webpack
Node.js
HTTP
Python
Kotlin
Nuxt
Question #18
Author:
admin
tags:
JavaScript
let x; x = (x = 5) + (x = 10); console.log(x); // x = ??
What will the console output be?
5
10
15
'510'
'numbernumber'
undefined
'' (empty string)
NaN
No output, a ReferenceError will occur.
Answer
Show explanation
Assigning a value to a variable is performed with the return of this value.
So the
(x = 5) + (x = 10)
transforms into
5 + 10
.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question (JavaScript)
Next question (JavaScript)
→
Write new comment