Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

Python 程式設計函式的模組的引入和使用入門教學

Python 程式設計函式的模組的引入和使用入門教學

[ 筆記 ] - API 基礎、JSON、curl 指令

[ 筆記 ] - API 基礎、JSON、curl 指令

筆記、[NET101] 網路基礎概論 ( 4 )

筆記、[NET101] 網路基礎概論 ( 4 )


Comments