Using script how set value varible value

Hello, Everyone any way to set edge variable into script tag like when I select any value then script tab into set variable value

// Dynamic data
var data =[{ id:1,name:"Test"}]

@each (it in data)
<option value="{{}}">{{}}</option>

this possible or another way to set variable ?

Use @set

I try but not work

Let’s see your implementation.

@each (it in data) {{}} @endeach

Can’t see where you used @set()