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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:36:47+00:00 2026-06-04T15:36:47+00:00

Let me explain it step by step A function of mine is doing a

  • 0

Let me explain it step by step

  1. A function of mine is doing a console.log() on an Knockout observable in a model
  2. Console says Array(0)
  3. However, at that point I click that array(0) it displays items. So it is not true there are no items in the array
  4. In between my Console.log() and the moment I click the array(0), the observableArray() has been filled with items, and thus is not empty anymore.

My question here is, is this functionality of the console wrong? Should it actually display the items, or just display an empty array. Why does this happen in the first place?

Or look it at the other way around, should the console update the array(0) with array(50) when there are 50 items in it.

And how do I overcome this issue? Code snippet on working with that:

var myModel = function(){
    this.myArray = ko.observableArray();
}

var model = new myModel();
console.log(model.myArray());

model.myArray.push('item');
  • 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-04T15:36:49+00:00Added an answer on June 4, 2026 at 3:36 pm

    For this issue, it helped me to add the data to another variable, and log that through console.log().

    Example:

    var myArray = [];
    
    var logArray = myArray;
    console.log(logArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me explain. I have several addresses on the page that I put
That's a hard title, let me explain what I mean, currently I'm programming a
Let me explain with an example. If n=4 and r=2 that means all 4
Can somebody explain step by step type inference in following F# program: let rec
Let me explain a bit the app i'm doing. I'm creating a central UDP
Let me explain my problem. I try to generate an array of categories. Here
let me explain well.. I'm trying to write a program that listen the keys
let me explain my current situation i have a SharePoint site lets say it
Let me explain. Suppose I want to teach Python to someone who only speaks
Let me explain what I mean : Let's say we have a menu with

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.