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 #100
Author:
admin
tags:
JavaScript
const arr = []; arr[-1] = 'text'; console.log(arr[-1]);
What will the console output be?
text
-1
undefined
null
Nothing. There will be an error.
Answer
Show explanation
In JavaScript any array is an object. You can add any property to an object and get this property value using bracket notation.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question
Next question
→
Write new comment