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

  • SEARCH
  • Home
  • 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 8478015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:37:40+00:00 2026-06-10T18:37:40+00:00

Here is my code: var A = (function(){ use strict; function FetchJSON(){ return someValue;

  • 0

Here is my code:

var A = (function(){
    "use strict";

    function FetchJSON(){
        return someValue;
    }

    var Class = function(){
        // how do I correctly call FetchJSON() from inside this class definition?
    };

    return {
        Class: Class,
        fetchJson: FetchJSON
    };
})()

So basically I’m using JSLint to clean up my code and I’m just calling FetchJSON() from inside the Class object/function definition but JSLint is telling me I need to use the word ‘new’ before the FetchJSON() call and I’m thinking I don’t. The code works with out the word ‘new’ just fine but JSLint is telling me it should have it. What’s the deal?

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-10T18:37:42+00:00Added an answer on June 10, 2026 at 6:37 pm

    Call the function fetchJSON instead of FetchJSON, so JSLint does not think it’s a constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is some code: var class = function(elem,div){ this.elem= elem; this.div = div; this.init
Passing this code through jsHint: var A = function (spec) { use strict; var
I have this code here: var Person = (function() { var name; var PersonConstructor
Here is my code: function currentCursPos(){ $(document).mousemove(function(e){ var pos= {"x":e.pageX,"y":e.pageY}; return pos }); }
Here in this code: $('#doneItem').click(function(){ $(this).each(function(index){ var item = 'personal' + index; alert(item); localStorage.removeItem('personal'
Here is my code: var showNo = 1; window.setInterval(function() { console.log(showNo); if(showNo === 1)
Here is my code: function pauseSound() { var pauseSound = document.getElementById(backgroundMusic); pauseSound.pause(); } I
Here is my chunk of code: var update_shipping_methods = function(methods) { $(methods).each( function(i) {
Question is already been asked in title. Here is a code: (function($){ var filter
Here is my Jquery code: $('#unblockButton').click(function () { var blockedlist = []; var count

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.