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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:24:22+00:00 2026-06-09T23:24:22+00:00

Im developing a very big application on Scalable Javascript Aplication Architecture, in the core

  • 0

Im developing a very big application on Scalable Javascript Aplication Architecture, in the core i have a simple function to asign a css property to a element.

establishCSSvalue : function( element, property, value ) {
 if( element && property && value ) {
jQuery( element ).css( property, value );
 } else {
//log wrong arguments
 }
}

If the variable value is equal to 0 the if go to the else, if i delete the value condition o fix the 0:

if( element && property ) {
if( element && property && ( value || value == 0 ) ) {

It works.

Anyone can explain me what its happening, or why? I cant understand or my knowlegde of javascript its not enough, in php is easy with isset. For me a variable with value = 0 exist…

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-09T23:24:24+00:00Added an answer on June 9, 2026 at 11:24 pm

    If you are simply trying to see that all three function arguments actually exist and are not undefined, then you can’t just check them for a falsey value as you are. You must specifically check to see if they are not undefined.

    You can do that like this:

    if (element !== undefined && property !== undefined && value !== undefined)
    

    The reason you cannot do this:

    if (element && property && value)
    

    is because any falsey value will cause that statement to fail. falsey values include null, false, 0, "", undefined and NaN. So, if you ONLY want to check to make sure it’s not undefined, then you need to specifically check for that rather than any falsey value.


    Note: If all you’re really trying to tell is whether the caller actually passed three arguments to the function when they called it, you can also check arguments.length like this:

    if (arguments.length === 3)
    

    or just check to see that the last variable is not undefined:

    if (value !== undefined)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have lately been developing a very simple app for iOS with PhoneGap. All
I'm developing application for android. my application has very big size (APKfile) that is
I use Qt + PyQt for developing. My application is very-very big (20 MB
im developing a very simple particle system in AS3, i have the particle (a
I'm developing a very simple gadget for Windows 7. I have created an index.html
I'm developing a very sensitive application for a client that needs to have 99.9999999999%
I am currently developing a very simple script in AutoHotKey, but it involves using
Im Developing a web application which is very critical. So authentication has to be
I have just found something very weird while developing a website. While trying to
I'm developing a desktop Mac OS X App that saves its very simple data

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.