尝试在 var 命名空间中声明变量时遇到问题 ..
jsFiddle .. http://jsfiddle.net/bobbyrne01/jeh7Y/
Error: SyntaxError: missing : after property id
Line: 23, Column: 8
Source Code:
var startTime = null;
var Utils = {
var startTime = null;
getStartTime: function(){
return startTime;
},
setStartTime: function(startTimeTemp){
startTime = startTimeTemp;
},
}
Utils.setStartTime(new Date());
alert(Utils.getStartTime());