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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:33:03+00:00 2026-05-26T20:33:03+00:00

EDIT: Syntastic is configured to use JSLint EDIT2: I am using JavascriptLint, not JSLint

  • 0

EDIT: Syntastic is configured to use JSLint

EDIT2: I am using JavascriptLint, not JSLint

On the below code syntastic warns function inside does not always return a value

function(){
 switch(age){
 case 1:
  return 'won';
 case 2:
  return 'too';
 case 3:
  return 'tree';
 default:
  throw 'wow man, you are old!';
  break; //technically redundant
 }
}

I realize default does not return a value, but the throw ends the execution. Is this a Syntastic error, or should I change my coding style? Should I put a return statement after throw?

  • 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-26T20:33:04+00:00Added an answer on May 26, 2026 at 8:33 pm

    Syntactic uses JSLint under the hood to check Javascript syntax.

    JSLint is known to be overcautious in order to avoid errors. You can either ignore the message to your better judgement, or turn off this particular warning, or add a redundant return there.

    Personally I prefer to satisfy JSLint’s requirements over turning off warnings. Just make sure to add a //Satisfying JSlint comment near the return so other people will understand the redundancy.

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

Sidebar

Related Questions

edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit: I have solved this by myself. See my answer below I have set
Im not sure about what authentification method I should use for my webservice. I've
EDIT How to simplify the following code: if(x(a) > x(b)) s = b; e
Edit: I just moved my HTTPRequest code into the onCreate, and now all of
EDIT: Sorry about ellipsis that's not what I actually have. For declaring an array
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot

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.