Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:36:24+00:00 2026-06-10T00:36:24+00:00

When I run JSlint on this piece of code I get this error Error:

  • 0

When I run JSlint on this piece of code I get this error

Error: Problem at line 25 character 26: ‘selectedDate’ is already
defined. var selectedDate = new Date(selectedDate);

Implied global: $ 1,4,13,14,26,27,28,31,33,34,42, updateSelects
13,19,21

http://jsfiddle.net/bzPYg/

I think it is referring to this code

'dateSelected', function(e, selectedDate, $td, state) {
    updateSelects(selectedDate);

How can I fix this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:36:25+00:00Added an answer on June 10, 2026 at 12:36 am

    The error sort of explains itself.

    Problem at line 25 character 26: ‘selectedDate’ is already defined.
    var selectedDate = new Date(selectedDate);

    You are declaring the variable selectedDate again, and you are filling it with a new Date object taking in the value of the original variable selectedDate. You should rename the variable to something else.

    var date = new Date(selectedDate);
    

    And just to note the error is occuring here:

    var updateSelects = function(selectedDate) {
       var selectedDate = new Date(selectedDate);
       ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error: JSON.parse: unexpected character when I run this statement in firebug:
I don't understand why I get the error message when I run JSLint with
Whenever I run my code, I get the error {error: Please use POST request}
I'm relatively new to Javascript, and I'd like to run the piece of code
I run this code here <html> <script type=text/javascript src=lib/jquery-ui-1.8.21.custom.min.js></script> <script src=http://127.0.0.1:5984/_utils/script/jquery.couch.js></script> <!--<script type=text/javascript src=lib/jquery-1.7.2.js></script>-->
Run jsLint on this fiddle . The script runs, but what is jsLint telling
I run the following code StringBuilder sb = new StringBuilder(); Stack stack = new
run(/test.js) in mongo shell. i always get error run(/test.js) shell: started program /test.js sh2516|
Possible Duplicate: JSLint: was used before it was defined I run JSlint and saw
Edit: Just found out this is a chrome problem, the code works fine in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.