Search code examples
javascriptangularjsprototypejs

how does javascript or condition work


i have written my code something like this

  this._users = users || [];

just wanted to know what does this mean to this._users?

Thanks for the help.


Solution

  • This basically is evaluating users to true or false. If it evaluation is true, than return users otherwise, assigns an empty array to this._users .