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 #12
Author:
admin
tags:
JavaScript
Can the name of an object property be an empty string, i.e. have no characters at all?
Yes
No
In early versions of JavaScript yes, now no
Answer
Show explanation
const obj = { '': 'Hi!', }; console.log(obj['']); // Hi!
Only the
string
type or the
symbol
type can be used as the name of an object property.
An empty string does not contradict this rule.
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