How to check the value of the orders key?

let obj = {orders:[null]} 

So you can, but in my opinion it looks crooked

 if(obj.orders[0] !== null) {...} 
  • Do you need exactly null , or just that there is no negative value? Why do I need to write [null] ? - ThisMan Nov.
  • one
    something seems to me that simply orders: null , not [null] - teran
  • From the server comes either null or objects - Lex
  • Is @Lex straight and in the array coming? - teran
  • 2
    fenshuy is to return null, not an array with null in it. - NeedHate

0