Looks like you have poorly formed JSON.

Paste it here to see if it validates: https://jsonformatter.curiousconcept.com/

Chances are that it is whatever comes before that comma.

Answer from Korgrue on Stack Overflow
🌐
Katecpp
katecpp.github.io β€Ί load-json
How to load external .json to array in js
Load the json data with $.getJSON. Following example is complete script that loads the questions from json to allQuestions array.
Discussions

javascript - Import JSON and convert to array - Stack Overflow
Impossible arrays can only have numeric keys, you have string keys there...I think, the JSON still sint that clear. ... @SnackerSWE if you "need it in an array" you're going to have to explain how that object is supposed to be mapped to a numerically-indexed sequence of values. Arrays in JavaScript ... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Importing .json into Typescript as an array - Stack Overflow
I am trying to import a .json file into Typescript as an array and do not know how to grab the values. More on stackoverflow.com
🌐 stackoverflow.com
how to import a json file into Javascript?
async function myFunction() { let data = await fetch("./data.json") .then(response => response.json()); console.log(data); // data.forEach(...); } myFunction(); More on reddit.com
🌐 r/learnjavascript
4
1
February 26, 2022
html - How to import an array file into a javascript file - Stack Overflow
I want to create a json file in ... able to import that file into my "main.js" file, and be able to use it even though the array itself is not in "main.js" anymore. ... taho is this a constant array, or do you anticipate it changing from a database eventually? If constant you only need add that script file to your page and it will be available. ... Possible duplicate of How to read an external local JSON file in JavaScript... More on stackoverflow.com
🌐 stackoverflow.com
🌐
CopyProgramming
copyprogramming.com β€Ί howto β€Ί how-to-import-json-file-to-javascript-array
Importing a JSON file as an array in JavaScript: A Step-by-Step Guide - Javascript
May 22, 2023 - In your case, onionarray should not be an array but rather an object (In fact arrays and objects are >pretty< similar in javascript). You can assign your jsondata like that: onionarray = JSON.parse (data); Share
🌐
Quora
quora.com β€Ί How-do-I-convert-JSON-file-to-Javascript-Array
How to convert JSON file to Javascript Array - Quora
Answer (1 of 8): A JavaScript object or value is converted to a JSON string using the JSON.stringify() method, with the option to replace values if a replacer function or replacer array is given, or to include only the specified attributes otherwise. For Example: [code]console.log(JSON.stringif...
🌐
W3Schools
w3schools.com β€Ί js β€Ί js_json_server.asp
<h1>JavaScript Loading JSON</h1>
JSON is often stored in files or returned by calls to web servers. JavaScript can load JSON and convert it into JavaScript values.
🌐
Pluralsight
pluralsight.com β€Ί blog β€Ί tech guides & tutorials
Convert a JSON File to an Array in React | Pluralsight
March 31, 2025 - To convert the array from the local JSON file to the JavaScript-based object, you can use the ES6 import statement to import the local JSON file and use it in the existing components.
Find elsewhere
🌐
Reddit
reddit.com β€Ί r/learnjavascript β€Ί how to import a json file into javascript?
r/learnjavascript on Reddit: how to import a json file into Javascript?
February 26, 2022 -

So i am using the fetch method to import my local json file into my javascript program and then assigning it to my variable `data`

let data = fetch("./data.json")
    .then(response => {
        return response.json();
    });

console.log(data)

this is the code I am using but it is giving the console value

Promise { <state>: "pending" }
​
<state>: "fulfilled"
​<value>: Array(6) [ {…}, {…}, {…}, … ]
​​
0: Object { title: "Work", timeframes: {…} }
​​
1: Object { title: "Play", timeframes: {…} }
​​
2: Object { title: "Study", timeframes: {…} }
​​
3: Object { title: "Exercise", timeframes: {…} }
​​
4: Object { title: "Social", timeframes: {…} }
​​
5: Object { title: "Self Care", timeframes: {…} }
​​
length: 6
​​
<prototype>: Array []
​
<prototype>: Promise.prototype { … }

but i just want that value part that is an array, cause i want to use those values with my for loop, can i get some help

🌐
Webdevtutor
webdevtutor.net β€Ί blog β€Ί typescript-import-json-as-array
Using TypeScript to Import JSON as Array
In this method, we use require to load the JSON file into the jsonData variable and then cast it as an array to get the desired JSON array. Another way to import JSON as an array is by using ES6 import statements with TypeScript.
🌐
Bobby Hadz
bobbyhadz.com β€Ί blog β€Ί javascript-import-json-file
Import a JSON file in JavaScript and Node.js (ES6 Modules) | bobbyhadz
To import a JSON file in JavaScript, make sure the `type` attribute on the script tag is set to `module`.
🌐
TutorialsPoint
tutorialspoint.com β€Ί article β€Ί how-to-import-local-json-file-data-to-my-javascript-variable
How to import local json file data to my JavaScript variable?
September 12, 2023 - fetch('./employees.json') .then(response => response.json()) .then(data => { console.log(data); console.log('Total employees:', data.Employees.length); }) .catch(error => console.error('Error loading JSON:', error)); With modern JavaScript modules, you can use dynamic imports:
🌐
freeCodeCamp
forum.freecodecamp.org β€Ί curriculum help
How do I import data from JSON to JavaScript? - Curriculum Help - The freeCodeCamp Forum
July 7, 2022 - I’m basically trying to populate a website with data taken from a JSON file and sorted out in JavaScript. Currently, the method I used was import JOBS from "./database/career.json" assert {type: "json"}; console.log(JO…
🌐
EncodedNA
encodedna.com β€Ί javascript β€Ί convert-data-in-json-file-in-an-array-using-javascript-or-jquery.htm
How to convert data in JSON file to an Array using JavaScript or jQuery
You’ll have to provide the URL of the JSON file to the method. Once the file is loaded, I’ll populating an array with the data using the push() method.
🌐
Stack Overflow
stackoverflow.com β€Ί questions β€Ί 73400619 β€Ί convert-data-from-json-file-to-javascript-array
Convert data from JSON file to JavaScript Array? - Stack Overflow
First, you gonna do is to convert your JSON string to Javascript Array by using the JSON.parse() Method and take all of the values of that object and push it using a for loop.