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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:55:23+00:00 2026-05-31T20:55:23+00:00

Currently I have a simple knockoutJS object, with a few observables. But this object

  • 0

Currently I have a simple knockoutJS object, with a few observables. But this object is to grow in the future (that’s a fact).

The object is filled with user information about the logged in user (with facebook JavaScript SDK).

The question now is, when I loose the user (logs out) I want to clear my user object. Currently I just would do every element manually (type them out). But this is not functionality I would like to have.

Is there a way (a function of some sort) that loops through all elements and just empties them all? Or is best practice to do it manually.

With manually I mean:

myObject.var("");
myObject.var2("");
myObject.array([]);
etc...
  • 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-31T20:55:24+00:00Added an answer on May 31, 2026 at 8:55 pm

    Since this is a custom object, there is no way javascript could guess how you want it to work.

    Are all your properties at the top level of your object? Any nested one? Possibilities are endless, therefore there is no built-in function for this.

    I’d suggest you create a helper function to empty it. So you don’t have to manually do it everytime.

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

Sidebar

Related Questions

There is probably is simple fix for this but I currently have code similar
I currently have a simple app that includes user authentication through devise and a
I currently have a simple form that when you click the save button will
Currently I have a simple maven project that is building a jar file and
I currently have a Perl CGI script that parses incoming XML requests using XML::Simple
I currently have a simple list view adapter that holds two rows of text.
I currently have a simple iPhone app that loads a custom subclass of UIView.
I currently have a simple application that needs to click on certain coordinates and
I currently have a simple rewrite that redirects /photos/2 to /photoviewer.php?photo=2 However I need
I currently have a simple tree view that contains one parent node with multiple

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.