33 lines
566 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
When using Backbone.js, the use of ``++has++`` to check attribute existence is clearer and more readable than the use of ``++get++``, and is therefore preferred.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 16:49:39 +02:00
----
if (myModel.get('myProperty')) { ... }
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 16:49:39 +02:00
----
if (myModel.has('myProperty') { ... }
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use "xxx.has('yyy')" instead.
endif::env-github,rspecator-view[]