lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Oct 12, 2020 at 3:48 PM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
>
> Sorry, hit send too early. Was going to say here:
> > a[1] == b[1]   --output: true
> > a[2] == b[2]   --output: true
> > a == b           --output: false    amazing!!!
> It's amazing that both "a[1]==b[1]" and "a[2]==b[2]" return "true" whereas
> "a==b" returns "false".
>
> Best regards
> Sunshilong

For tables, == will just tell you whether a and b are the same table,
not whether they have equal contents. That's like python's "is",
Java's "==", and JavaScript's "===".