码迷,mamicode.com
首页 > 其他好文 > 详细

Difference between == and ===

时间:2018-05-29 12:00:14      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:obj   enc   ack   poi   inter   cal   ring   point   type   

In swift 3 and above

=== (or !==)

  • Checks if the values are identical (both point to the same memory address).
  • Comparing reference types.
  • Like == in Obj-C (pointer equality).

== (or !=)

  • Checks if the values are the same.
  • Comparing value types.
  • Like the default isEqual: in Obj-C behavior.

Here I compare three instances (class is a reference type)



https://stackoverflow.com/questions/24002819/difference-between-and

Difference between == and ===

标签:obj   enc   ack   poi   inter   cal   ring   point   type   

原文地址:https://www.cnblogs.com/feng9exe/p/9104135.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!