CODING_INTERVIEW_PREPARATION Telegram 783
Answer: No

As we have 2 == operators, so they are executed from left to right.

a == b == c
⇒ (a == b) == c
⇒ (10 == 10) == 10
⇒ true == 10
⇒ 1 == 10
⇒ false

Why is true converted to 1?
The rule for == says if one of the operands is boolean, it's converted to number before the comparison.
true is converted to its number value, which is 1.
5



tgoop.com/coding_interview_preparation/783
Create:
Last Update:

Answer: No

As we have 2 == operators, so they are executed from left to right.

a == b == c
⇒ (a == b) == c
⇒ (10 == 10) == 10
⇒ true == 10
⇒ 1 == 10
⇒ false

Why is true converted to 1?
The rule for == says if one of the operands is boolean, it's converted to number before the comparison.
true is converted to its number value, which is 1.

BY Coding interview preparation




Share with your friend now:
tgoop.com/coding_interview_preparation/783

View MORE
Open in Telegram


Telegram News

Date: |

Over 33,000 people sent out over 1,000 doxxing messages in the group. Although the administrators tried to delete all of the messages, the posting speed was far too much for them to keep up. bank east asia october 20 kowloon Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. ZDNET RECOMMENDS Administrators
from us


Telegram Coding interview preparation
FROM American