Toggle navigation
Email or Username
Password
Remember
Login
Register
|
I forgot my password
Questions
Unanswered
Tags
Users
Ask a Question
How do the objects?
0
like
0
dislike
5
views
var a = "t";
var b = {};
a = b;
a.x = 7;
b.y = "m";
a.y = b.x;
b.x = "p";
console.log(a);
console.log(b);
Tell me on what basis the assignment. Don't understand why the output in x is 'p' in both objects, and y the number 7, also in both sites.
javascript
asked
Apr 13, 2019
by
satzuru
|
5
views
answer
comment
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
0
like
0
dislike
Because
a
and
b
are references to the same object.
Read more here
.
answered
Apr 16, 2019
by
space2pacman
ask related question
comment
Please
log in
or
register
to add a comment.
Related questions
0
like
0
dislike
4
answers
Must read n large objects (amounting to ~4 billion properties) in the backend how to do it on the site Node.js the most expeditious way?
asked
Jun 12, 2019
by
kamaltdin
javascript
node.js
arrays
0
like
0
dislike
2
answers
What I do wrong when creating objects?
asked
May 21, 2019
by
pilolin
php
OOP
0
like
0
dislike
1
answer
In three.js to do so is not passed through objects on stage?
asked
May 20, 2019
by
Ork00
three.js
0
like
0
dislike
1
answer
How to make objects do not overlap each other when dragging?
asked
May 20, 2019
by
youkerni
unity-game-engine
0
like
0
dislike
1
answer
How to parse and do a merge objects??
asked
May 12, 2019
by
campus1
javascript
Most popular tags
javascript
php
css
html
jquery
wordpress
python
linux
web-development
mysql
android
windows
java
layout
c#
computer-networks
node.js
cpp
iron
yii
vue.js
1C-Bitrix
react
laravel
django
nginx
system-administration
search-engine-optimization
api
ubuntu
the-it-education.
ajax
sql
programming
hosting
cms
design
apache
google-chrome
bootstrap
Vkontakte
macos
google
network-administration
git
laptops
algorithms
regular-expressions
unity-game-engine
email
angular
database
network-equipment
software
wooŃommerce
debian
.net
ios
information-security
video
law-in-it
browsers
books
parsing
wi-fi
game-development
career
htaccess
postgresql
telegram
mikrotik
mobile-development
ruby-on-rails
the-domain-name-system
modx
Yandex
c
json
opencart
Habr
freelance
vpn
asp.net
windows-server
symfony
bots
hard-drives
math
qt
DIY
audio
frontend
payment-system
bash
electronics
gulp.js
user-interface
docker
online-shopping
110,608
questions
257,186
answers
0
comments
33,863
users