How to judge a.b.c in js? when getting attribute c, you need to nest to determine whether it is empty or not, in c-sharp? Grammar is fine. Is there a more convenient way to write it in js?

how to judge a.b.c in

js. When getting attribute c, you need to nest to determine whether it is empty or not. In c-sharp? Grammar is fine. Is there a more convenient way to write it in js?

Feb.28,2021

https://codeshelper.com/q/10.
refer to this answer


you can wrap it directly with try-catch , otherwise it can only be nested or & & . The second one looks like this

.
if(a.b && a.b.c) {
  // Do something here
}

is not A.B & & a.b.c | | 'default'
but what are the values that you say are empty?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b334b4-2be66.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b334b4-2be66.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?