Discerning dead ends in a table

How can a script search a table to find a (non-specific, just any) dictionary value?

Say that I have the dictionary:

globalDict = {
	a = "apple";
	b = "banana";
	c = "cranberry";
	bearwithmehere = {
		"orange" = "yes"
		"pear" = 1
		"pineapple" = false
	};
}

For the purpose of this example, we do not know the name of ‘bearwithmehere’ or its value.

If I am iterating through globalDict in search of a dictionary (like ‘bearwithmehere’), how would I identify if one of the keys of globalDict is dictionary value?

Update, realized im searching for nested tables here. My question still stands. How would I know if a value of globalDict is a nested table?

use type() to see if its a table

1 Like

You are my newest bestest friend.

Much thanks! This saved me so much time.

1 Like