JS Using OR for Default Values
The double pipes (||) which represents the logical OR operator, can also be used to set a default value on a variable.
%MINIFYHTML3e976415847e95bd1c8e1c1755d108a223%let name = firstName || 'Brian'
Code language: JavaScript (javascript)
In the case above, if firstName is null, then the default value of ‘Brian’ will be added.
JS Ternary Logic – Continuous Coder
3 years ago[…] JS Using OR for Default Values […]