Get Boolean from Query Parameters

up:: TypeScript

You can get value from the query string and assign a Boolean using ternary operator:

const hasDiscount = new URLSearchParams(window.location.search).get('discount');
const discount = (hasDiscount = 'true'|| hasDiscount = '1') ? true : false;
}