Equality comparisons and sameness
type comparison tables



* Javascript 정오 비교표
https://dorey.github.io/JavaScript-Equality-Table/
   https://developer.mozilla.org/ko/docs/Web/JavaScript/Equality_comparisons_and_sameness




* php 비교표
https://phpcheatsheets.com/compare/
   https://www.php.net/manual/en/types.comparisons.php
   https://www.php.net/manual/en/language.operators.comparison.php



//=================
< 삼항 연산자 >

[ PHP ]
* 다음은 2개는 동일한 출력값

echo ( isset($val) ? $val : null ); // 삼항 연산자(Ternary Operator )
echo ( $val ?? null ); // NULL 병합 연산자(Null Coalescing Operator)
- $val 이 undefined 상태이면 null
- $val=0 이면 0을 출력


//========
echo ( isset($val) ?  : null );//주의!! 권장하지 않음
- $val=0 이면 1을 출력



//==============
[ Javascript ] 
조건부 삼항 연산자(conditional ternary operator) 

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Conditional_Operator



Posted by 코덴스

댓글을 달아 주세요