JSFiddle - React, Tailwind, and code Playground

JavaScript

// 임의로 설정된 값
var width = 100;
var height = 200;

// 결과를 저장하기 위해 의도적으로 0을 할당
var result1 = 0;
var result2 = 0;

// if ~ else
if ( width > height ) {
  result1 = width;
}else{
  result1 = height;
}

// 조건부 연산자(삼항연산자)
result2 = (width > height) ? width : height;

// 적용 된 값의 비교
console.log(result1, result2, result1 == result2);