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 5942607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:16:39+00:00 2026-05-22T16:16:39+00:00

Is it possible, perhaps by using some directive in the JavaScript code, to throw

  • 0

Is it possible, perhaps by using some directive in the JavaScript code, to throw warnings or errors if variables are used without being declared first?

In case that isnt possible, is there perhaps some plugin to force Eclipse (or any other IDE) to detect undeclared variables?

  • 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-05-22T16:16:40+00:00Added an answer on May 22, 2026 at 4:16 pm

    Yes, it’s possible to do this using strict mode. You enable it by putting a statement containing the string literal "use strict" at the top of a file or function to enable strict mode for that scope.

    "use strict";
    doesNotExist = 42; // this throws a ReferenceError
    

    This feature is now supported by all updated browsers. Older browsers wont’ throw an error since "use strict"; is a valid statement and is simply ignored by browsers that don’t support it. You can therefore use this to catch bugs while developing, but don’t rely on it throwing an exception in your users’ browsers.

    Strict mode

    JavaScript’s strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode". Strict mode isn’t just a subset: it intentionally has different semantics from normal code.

    Strict mode for an entire script is invoked by including the statement "use strict"; before any other statements.
    (Source, Documentation)

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

Sidebar

Related Questions

I have used the jQuery Qtip plugin to create some tooltips using the following
Here's an interesting problem. Is there a way to write some code using LINQ
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What's the
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
I'm trying to do some caching using VaryByParam AND VaryByHeader. When an AJAX request
I'm using the Streaming API JsonParser of the Jackson library to do some custom
I am using a JSF 2.0 to create a web app (purely jee6, without
I have a need to do some drawing using win32/GDI (Native, not .NET), and
Is there any way to resize an entire Flash project using Actionscript or some

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.