Short Remark(1) : React.js & JavaScript (last update: 2020.12.28.)

devpark·2020년 12월 28일
0

React.js & JavaScript

목록 보기
9/11

1. Syntax - Expressions & Operator & JSX tags

1-1. Shorthand of React.Fragment


Notion의 Short Remark : React.js & JavaScript 페이지 바로가기


1. Content

2. Conclusion

// syntax : origin
<React.Fragmnent></React.Fragment>
// syntax : shorthand
<></>

1-2. JavaScript :: Difference Between =, == and ===

0. References

Difference Between =, ==, and === in JavaScript - Guru99


1. Content

What is === in JavaScript?
===(Triple equals) is a strict equality comparison operator in JavaScript, which returns false for the values which are not of a similar type. This operator performs type casting for equality. if we compare 2 with "2" using ===, then it will return a false value.
삼중 equals는 값들이 같은 타입이 아닌 경우 false를 반환하는 JavaScript의 엄격한 동등 비교 연산자이다. 이 연산자는 형변환 (type casting)을 수행한다. 만약 우리가 2(int/number type)와 "2"(String type)을 비교한다면 이는 false를 반환할 것이다.


SEE ALSO : what is == in JavaScript?
*Double equals(==) is a comparison operator, which transform the operands having the same type before comparison. So, when you compare string with a number, JavaScript converts any string to a number. An empty string is always converts to zero. A string with no numeric value is converts to NaN(Not a Number), which returns false.
이중 equals는 비교 전 항들을 같은 타입으로 변환하는 비교 연산자이다. 따라서 문자열과 수를 비교할 때 javaScript는 어떤 문자열도 수로 변환한다. 빈 문자열은 언제나 0으로 변환한다. 수의 값이 없는 문자열은 false를 반환하는 NaN(수가 아님)으로 변환한다.


SEE ALSO : why use = in JavaScript?
Here are the important uses of = in JavaScript:*
*= JavaScript operators assigns a value to the left operand depends on the value of operand available on the right side. The first operands should be a variable. The basic assignment operator is =, that assigns the value of one operand to another. That is, a=b assigns the value of b to a.*
JavaScript의 중요한 쓰임은 이러하다:
= JavaScript 연산자는 가능한 우측 항의 값에 따라 좌항에 값을 대입한다. 첫 째 항은 변수일 수 있다. 기본 대입 연산자인 =는 한 항의 값을 그 외에게 할당한다. 즉, a=b는 b의 값을 a에 대입한다.


How === Works Exactly?

  • Strict equality === checks that two values are the same or not.
    엄격한 비교 ===는 두 값이 같은지 아닌지 확인한다.

  • Value are not implicitly converted to some other value before comparison.
    값들은 어떠한 다른 값을 비교 이 전에 암묵적으로 변환하지 않는다.

  • If the variable values are of different types, then the values are considered as unequal.
    변수의 값들이 다른 타입이라면 그 값들은 동등하지 않은 것으로 여겨진다.

  • If the variable are of the same type, are not numeric, and have the same value, they are considered as equal.
    변수들이 같은 타입이고, 수가 아니며, 값은 값을 가진 경우 그들은 동등한 것으로 여겨진다.

  • Lastly, If both variable values are numbers, they are considered equal if both are not NaN (Not a Number) and are the same value.
    마지막으로, 두 변수의 값들이 수이고, 둘 다 NaN이 아니며 같은 값을 갖는 경우 그들은 동등한 것으로 여겨진다.


2. Conclusion


profile
아! 응응애에요!

0개의 댓글