Question: Does operand order matter in JavaScript string comparison?

Question

Does operand order matter in JavaScript string comparison?

Answers 0
Added at 2016-12-21 08:12
Tags
Question

I've found an old app that uses Angular in the front-end. In a few places I've seen something like this:

<div ng-if="('eBook' === book.type)">
  ...
</div>

<div ng-if="('paperBook' === book.type)">
  ...
</div>

It was odd for me to see this operands order, because for me it's more natural to write ng-if="(book.type === 'paperBook')". So I was wondering - is there a particular (performance) reason to put operands like this?

Answers
Source Show
◀ Wstecz