Godot Engine C# verify in dictionary "Godot.Collections.Array{}" and gdscript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ariel Gimenez

Hello, I am looking at a GDscript code and I see that it is possible to check directly in a dictionary if it is true or false as I show in this code.

var intercepto = espacio.intersect_ray(origen, destino, [], 1)
		print(intercepto)
		if intercepto: #I use a condition to check a dictionary
			var personaje = get_parent().get_node("Personaje")

However if I do this in godot c # it doesn’t work

intercepto = espacio.IntersectRay(origen,destino,new Godot.Collections.Array{}, 1);
        
        if(intercepto)//no work
        {
            
        }

I was seeing in Godot c # that to do the check you have to see if that key exists in the dictionary,

        intercepto = espacio.IntersectRay(origen,destino,new Godot.Collections.Array{}, 1);

        if(intercepto.Contains("position"))//if the dictionary has that key
        {
        }

The question I have is:
-Godot engine GDscript when placed in the condition the dictionary automatically checks the keys?

-Is the interpretation with c # correct?

API GODOT ENGINE GDSCRIPT

API GODOT ENGINE C#

images