OR operator doubt

In JS this is used almost as a fallback. It’s not that it returns one or other, but it will return the one that is not null or undefined.

In GDScript u can’t do the same. What u can do in this case is use a ternary approach like:

var current_color := user_color if user_color != null else default_color

Edit: Btw i didnt saw @trizZzle comment :sweat_smile:. It’s pretty much the same, sorry.

2 Likes