This is the code:
Sub Button3_onclick()
Dim myCar
Dim i
myCar = new Car("Ford", "Mustang", 1969)
'This should work, but it doesn't!
'For Each i in myCar
'But this works:
JavaScript
for (i in myCar) {
End JavaScript
If myCar.hasOwnProperty(i) Then
Print i & ": " & myCar[i]
End If
Next i
End Sub
As you can see: In my code does this lines work:
JavaScript
for (i in myCar) {
End JavaScript
but
For Each i in myCar
doesn’t! and now it becomes weird: If I delete
If myCar.hasOwnProperty(i) Then
and
End If
then it works even with
For Each i in myCar
Here is a project to test both bugs:
BugObj.nsx (21.1 KB)