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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:56:03+00:00 2026-05-23T17:56:03+00:00

I accidentally came across $(undefined) in a statement below, where params is an object:

  • 0

I accidentally came across $(undefined) in a statement below, where params is an object:

var $this = $(params._this) || $(this);

This did not work, as $(params._this) is a jQuery object and is always evaluated to true.

Funny enough, I was not sure how to check for it. It is not an empty object (i.e. $.isEmptyObject($(undefined)) == false), nor is it a function or a “plain object” (i.e. $.isPlainObject()).

I ended up modifying the statement to the following:

var $this = (params._this == undefined) ? $(params._this) : $(this);

My question is, is there any way to “evaluate” (not sure what word to use) $(undefined)? Is there any use for this?

  • 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-23T17:56:04+00:00Added an answer on May 23, 2026 at 5:56 pm
    var $this = $(params._this || this);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I accidentally came across this weird but valid syntax i=3 print i+++i #outputs 6
I came across this issue accidentally when I was going over inheritance and up/down
I came across this code accidentally: #include<stdio.h> int main() { int i; int array[3];
Today I came across a problem where someone had accidentally committed a proj.user file
accidentally at work I wrote the following line of code: string x = (object)
I accidentally pushed a commit to GitHub. Is it possible to remove this commit?
Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed
I accidentally put the opening brace of my function definition after the return statement
I accidentally executed chown www-data.www-data /* it was not recursive so i guess my
I accidentally did a git rm filename.txt -f now if I do a git

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.