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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:01:15+00:00 2026-06-12T16:01:15+00:00

what exactly is going on with this javascript statement: var loadPrevious = (loadPrevious ||

  • 0

what exactly is going on with this javascript statement:

var loadPrevious = (loadPrevious || function() {});

From my understanding, the variable loadPrevious is either going to be an anonymous function or the value loadPrevious

EDIT:

ok great thanks for the answers and comments. But why then would there be a statement like this:

var app;
loadPrevious(app = launchApplication($("#target"),0));

what does loadPrevious do here? And why do it this way?

  • 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-12T16:01:16+00:00Added an answer on June 12, 2026 at 4:01 pm

    it checks to see if loadPrevious has already been assigned a value. if not, it assigns it an empty function.

    this syntax is the javascript equivalent of the C++ or C# ternary syntax

    var loadPrevious = loadPrevious != null ? loadPrevious : () => {}; 
    

    in C#, for example.

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

Sidebar

Related Questions

I have come across this javascript code. var digit_name = function() { var names
Possible Duplicate: JavaScript: formatting number with exactly two decimals Maybe I'm going about this
I'm going to implement this The layout is exactly like it is tables so
languages used: html, javascript/jquery, and php 5.2 So I created this function that onclick
I am going through this tutorial http://www.9lessons.info/2009/04/exactly-twitter-like-follow-and-remove.html on how to implement a twitter-like follow/unfollow
Having just spent ages debugging this, I'm keen to understand what exactly is going
Questions exactly like this have been asked before, i've read them all and tried
So I'm actually going to use this to do some dynamic form layout generation
This is not exactly a question, because in this moment I'm not able to
I often see JavaScript code which checks for undefined parameters etc. this way: if

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.