Godot Version
v4.2.1
Question
I’m pretty familiar with python and started to learn GDScript recently. I tried to write:
var array = [0, 1, 2, 3, 4]
var new_array = [i for i in array if i >= 3]
But it keeped reporting the same error:
‘Expected closing “]” after array elements.’
I can’t figure out the problem after checking the code over and over again. So I guess is this syntax not supported in GDScript? And I looked over the array part in documentation and didn’t find anything helpful.