After creating an interface for my dictionary and initializing it, I encountered an unexpected output when trying to print the keys.
export interface IHash {
[tagName: string] : string;
}
var x : IHash = {};
x["first"] = "details";
x["second"] = "details";
Upon running let keys = Object.keys(x);
, the printed result was 0
and 1
. This seemed strange as I was anticipating first
and second
to be displayed. Should I loop through it in order to obtain this desired outcome?