Javascript Object.create inside object?

This doesn't seem to work:
const myObject = {
masses: [
Object.create(mass, {
name: 'Front Seats',
armInches: 80.5
}),
Object.create(mass, {
name: 'Fuel',
armInches: 95,
weightMaxPounds: 2179.45
},
Object.create(mass, {
name: 'Rear Seats',
armInches: 118.1
}),
Object.create(mass, {
name: 'Baggage',
armInches: 142.8,
weightMaxPounds: 200
}),
]
}
const myObject = {
masses: [
Object.create(mass, {
name: 'Front Seats',
armInches: 80.5
}),
Object.create(mass, {
name: 'Fuel',
armInches: 95,
weightMaxPounds: 2179.45
},
Object.create(mass, {
name: 'Rear Seats',
armInches: 118.1
}),
Object.create(mass, {
name: 'Baggage',
armInches: 142.8,
weightMaxPounds: 200
}),
]
}
1 Reply
Zach
ZachOPā€¢15mo ago
which is weird because this works:
export const default_templates = [
Object.create(PA28_161, {
name: 'OHO YLIL',
weightEmptyPounds: 1521.45,
armEmptyInches: 86.18
}),
Object.create(PA28_161, {
name: 'AGD YLIL',
weightEmptyPounds: 1483.4,
armEmptyInches: 85.5
}),
Object.create(PA28_161, {
name: 'MGV YLIL',
weightEmptyPounds: 1432.1,
armEmptyInches: 86.67
})
];
export const default_templates = [
Object.create(PA28_161, {
name: 'OHO YLIL',
weightEmptyPounds: 1521.45,
armEmptyInches: 86.18
}),
Object.create(PA28_161, {
name: 'AGD YLIL',
weightEmptyPounds: 1483.4,
armEmptyInches: 85.5
}),
Object.create(PA28_161, {
name: 'MGV YLIL',
weightEmptyPounds: 1432.1,
armEmptyInches: 86.67
})
];
nvm it was a missing ) šŸ¤¦
Want results from more Discord servers?
Add your server