最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Reference Error newDate is not defined? - Stack Overflow

matteradmin5PV0评论

I get the Error Message:"Uncaught ReferenceError: newDate is not defined" Why?

<script>
var str = newDate('1992-05-02');
alert(str);
</script>

I get the Error Message:"Uncaught ReferenceError: newDate is not defined" Why?

<script>
var str = newDate('1992-05-02');
alert(str);
</script>
Share Improve this question asked Jul 3, 2015 at 17:48 Mago99Mago99 632 silver badges10 bronze badges 1
  • Add a space: new Date(...); – RobIII Commented Jul 3, 2015 at 17:49
Add a ment  | 

1 Answer 1

Reset to default 4

new Date

not

newDate

You're instantiating a constructor called Date.

Post a comment

comment list (0)

  1. No comments so far