+ 1

Let code having problem!

What,s the problem:- let selectedColors =["red,blue"]; selectedColors[2] ="green"; console.log(selectedColors) When code run it,s show some () brackets why?

6th Jul 2021, 6:35 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
18 Respuestas
+ 4
let selectedColors = ["red","blue"];
6th Jul 2021, 6:42 PM
visph
visph - avatar
+ 3
well, such console output must be done by a browser console (in sololearn console is emulated, even in web version), meaning by running your html (js) file as standalone inside a browser ^^ the most near result in sololearn would be to use: console.log(JSON.stringify(selectedColors)); but that doesn't give you a clickable output wich can expand the array content as a tree ^^
6th Jul 2021, 7:05 PM
visph
visph - avatar
+ 2
Its running okay for me. Paste your codes in a code playground and paste the link here.
6th Jul 2021, 6:37 PM
minirkk
minirkk - avatar
+ 2
Thanks visph
6th Jul 2021, 6:42 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
For me it,s showing ( "red,blue", "<null>", green )
6th Jul 2021, 6:38 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
6th Jul 2021, 6:42 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
Ok me trying this code wait please
6th Jul 2021, 6:42 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
Thanks,let me check
6th Jul 2021, 6:42 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
Now it,s also showing this ( red, blue, green )
6th Jul 2021, 6:44 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
bracket are showed in web version of code playground console... on my app version they are just showed as red,blue,green... don't know how it is showed in recent version of app (or even in iOS app) to control how they are outputed, convert the array explicitly to a string: console.log(selectedColors.join(" : "));
6th Jul 2021, 6:48 PM
visph
visph - avatar
+ 1
So it,s mean ewherytime code change so what,s the benifit to learn code☹️
6th Jul 2021, 6:52 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
but i love coding 😁
6th Jul 2021, 6:53 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
no it means than console implementations are not always the same... but console is usually used to debug, not to final output ^^ to final output you must use html document as target ;P
6th Jul 2021, 6:54 PM
visph
visph - avatar
+ 1
I want to make like this https://youtu.be/oigfaZ5ApsM
6th Jul 2021, 6:56 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
Ok thanks😁
7th Jul 2021, 8:21 AM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
+ 1
Let selectedColor = ["red","blue"] paste this role in your code and your code is run
8th Jul 2021, 3:43 PM
MOHAMMAD AZMAL ALI
MOHAMMAD AZMAL ALI - avatar
0
Ok
8th Jul 2021, 3:49 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar
0
Physics?
8th Jul 2021, 4:13 PM
Coder Pro[ Less Active 📕📒📒study] Publishing App
Coder Pro[ Less Active 📕📒📒study] Publishing App - avatar