The output is displaying an Object instead of a numerical value in JSON

When I try running the URL in Chrome, the output I receive is:

{
  "Train_score": {
    "0": 0.9892473118
  },
  "Test_score": {
    "0": 0.9831932773
  }
}

However, when I attempt to use the following code to retrieve the JSON data using Javascript,

const fetch = require("node-fetch");

var obj

fetch(`url`)
    .then(res => res.json())
    .then(data => obj = data)
    .then(() => console.log(obj))
    .catch(err => console.error(err));

The output I get is:

Object {Train_score: Object, Test_score: Object}
.

I am puzzled as to why it's not displaying the numerical value. My code is being run in VSCode.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Angular 6's httpClient to securely post data with credentials

I am currently working with a piece of code that is responsible for posting data in order to create a new data record. This code resides within a service: Take a look at the snippet below: import { Injectable } from '@angular/core'; import { H ...

Navigate to the top of the page prior to updating the Link route in NextJS

Whenever I click on a link to navigate to a new page, the page loads and immediately scrolls to the top. I want to change this behavior so that the scroll resets to the top before the new page is rendered. You can observe this issue on . If you scroll do ...

Enhance User Experience with the Tooltip Feature and Customized

Here is the jQuery code I am using to style my tooltips: $(function() { // select all input fields within #tooltips and attach tooltips to them $("#tooltips :input").tooltip({ // place tooltip on the right edge position: "cen ...

Is there a way to retrieve all results from a ReactiveList?

My attempt to retrieve all data has been unsuccessful as I am only able to obtain the number of results specified in the 'size' parameter. Below is a snippet of my code. <ReactiveList componentId="results" dataField="original_title" siz ...

Collapse the active panel on a jQuery accordion with a click event

I'm currently utilizing the Simple jQuery Accordion created by CSS-Tricks, and I am seeking guidance on how to enable the active panel to close when clicking on the link within the dt element. The scenario where I am implementing this is as a menu in ...

Specify the return type based on specific parameter value

I'm facing a situation where I have two definitions that are identical, but I need them to behave differently based on the value of the limit parameter. Specifically, I want the first definition to return Promise<Cursor<T>> when limit is g ...

What are the best practices for managing live notifications with WebSocket technology?

I have developed a real-time chat application in React.js with Socket.io, but I want to implement a new feature. Currently, User A and User B can only communicate if they both have the chat open. I would like to notify User B with a popup/notification wh ...

Unable to retrieve the user ID from a Discord username using Discord JS

let string = `${args[1]} ${args[2]}` console.log(string) const idofuser = client.users.cache.find((u) => u.username === `${string}`).id I am facing an issue with DiscordJS where it says "cannot read property 'id' of undefined" when trying to ...

Tips for automatically inserting a "read more" link once text exceeds a certain character count

Currently utilizing an open-source code to fetch Google reviews, but facing an issue with long reviews. They are messing up the layout of my site. I need to limit the characters displayed for each review and provide an option for users to read the full rev ...

Retrieving ng-pattern as a variable from a service

Hey there! I'm currently working on an application that requires extensive form validation across multiple pages. To streamline this process, I am attempting to extract validation patterns from a service used among the controllers. However, I've ...

Problem with redirecting when using HTTPS

I recently implemented an SSL Certificate and made changes to the web.config file. Here is the updated code: <system.webServer> <rewrite> <rules> <rule name="removed by me" stopProcessing="true"> ...

I attempted to show the date in 'dd-mm-yyyy' format using Swift3, however, it is showing nil. Could you please review the code I have provided below?

After retrieving data from a JSON service, I attempted to convert the date '2017-07-18T00:00:00' into '18-07-2017', but my code below is returning nil. Could you please review it? let date1 = item["StartDate"] as? AnyObject //2017-07-1 ...

Storing JSON data in a SQL database

Storing JSON in an MsSql database and passing it to Javascript via a PHP script has been working perfectly. However, when trying to include extra text that is not part of the formatting string, like d, h, a, or p characters, encountered some challenges. Lu ...

Determine whether the specified date falls on a public holiday within the selected

I'm currently working with Angular 12 and I need to determine whether today is a regular workday or a day off for employees, including weekends and public holidays. I attempted to use the date-holidays package by importing it like this: import Holida ...

What is the best way to remove multiple IDs from req.params using Sequelize?

Is there a way to handle req.params that contain multiple IDs? I need to search for and delete these multiple IDs. Here is the code snippet: const ids = req.params; const masterFunders = await masterFunder.findOne({ where: { id: ids ...

"Troubleshooting problems with converting XML to Json and deserializing objects - Could InfoPath namespaces

I am currently exploring the process of loading a large batch of InfoPath XML files into Cosmos DB as JSON files to test out a potential project. However, I am facing challenges when it comes to converting the XML files into JSON and then loading them back ...

Tips on using Ajax to post in HTML

Here is the code I have been working on: <script type="text/javascript"> var xmlDoc; var xmlhttp; function loadRates() { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = readRates; xmlhttp.open("GE ...

Tips on appending a parameter to an image URL using JavaScript

On my website, I am able to insert images with specified width and height using this code: <img src="image.php?w=100&h=100"> I would like the image size to change based on the device screen width. For screens smaller than 600px, I want to displa ...

The second JSP page fails to load following an AJAX POST request

The following code snippet is found in page1.jsp. $.ajax({ type: "post", url: "page2.jsp", data: newdata, success:function(msg){ return msg; } ...

Creating an event emitter instance

I'm intrigued by the process of objects transitioning into event emitters. The documentation showcases code that resembles the following: var EventEmitter = require('events').EventEmitter; function Job(){ EventEmitter.call(this); } I fi ...