if we consider X as month i want to check if X was bigger than 24, then divide it in 12 and return a number otherwise if it was smaller than 24 i want the code to return X itself.
note that the project is in Laravel and i want to do this with inline JavaScript code.
i tried to do it this way
<script>
const guaranteeTime = "{{$product->guarantee_time}}"
function guaranteeConvert() {
const guaranteeTimeNew = guaranteeTime / 12;
}
if (guaranteeTime > 24) {
guaranteeConvert();
}
</script>
thnaks