我正面临一个错误,我可以使用node.js 4.0应用程序中的以下代码进行复制:
"use strict";
var Immutable = require("immutable");
class AspectType {
constructor(htmlLabel) { this.hhtmlLabel = htmlLabel; }
htmlLabel() { return this.hhtmlLabel; }
}
var AspectTypes = Immutable.OrderedMap()
.set("C",new AspectType("xxx"))
.set("D",new AspectType("yyy"))
.set("E",new AspectType("zzz"));
for (var retr in AspectTypes.values()) {
console.log(retr.htmlLabel());
}
我收到以下错误消息,为什么?
TypeError: retr.htmlLabel is not a function
at Object.<anonymous> (...\testt.js:17:22)