Как использовать значения из файла JSON, созданного в другом файле JS?
const billingInfo = import("billing.json"); var addressInfo = { 'first_name': first_name, //output: not defined 'last_name': last_name //output: not defined };
Файл импорта:
fetch('billing.json').then(response => response.json()) .then(obj => console.log(obj))
var obj = require('./billing.json'); console.log(obj);