Page 1 of 1

A warn when defining a litteral object with twice the same key.

Posted: 10 Jun 2019, 17:55
by FredOoo
That would be nice to get a warn when defining a litteral object with twice the same key.

Code: Select all

;#! AHK  v2
#Warn

test := { a:"AA", a:"BB" }

flatObj( obj ) {
	txt := ""
	for key, value in obj
		txt .= key ": " value "`n"
	return txt
}

MsgBox % flatObj( test )  ;  a: BB