If you have variable definitions that are quite complex, or are going to be reused within your script, it is best practice to define these variables as a separate
function
. The variables in the estimateCost(order)
function can then reference these functions to simplify your script. You can define any functions you want, however, below are some example functions you might find useful:
0) ? window.innerWidth : screen.width;
if(width >= 1300){
largeDevice = true;
}
else{
largeDevice = false;
helpCentreNavOpen = false
}">
Using functions
1400" id="toc-container" class="page-manuals__toc" aria-label="Table of Contents">
Contents
Contents
Comments