How does TP5 use judgment statements in JS?

write the following in body, but not in JS.

Mar.22,2021

<script>
var uid = {$Think.cookie.uid};

if(uid){
    
}
</script>

it is recommended that the configuration of the template be modified to {{}}
< script >
var uid = "{{$Think.cookie.uid}";

if (uid) {

}
< / script >


< H1 > you can store values with hidden fields and use js to get the values of hidden fields. < / H1 >
Menu