You have two errors:
- Invalid shorthand property initializer
- Uncaught ReferenceError: computer is not defined
These sound scary but they are both quite straight forward to fix.
Invalid shorthand property initializer
{drive: "floppy", cpu = "intel", ram: "ddr"}
^
This = should be a : like the other bits of your object. If you'd have Googled this on its own you would have been able to fix it yourself. The shorthand syntax is something else you can use, so if you wrote something like:
var cpu = "intel";
var computer = {drive: "floppy", cpu, ram: "ddr"}
That would be an example of valid shorthand, and is the same as writing
var cpu = "intel";
var computer = {drive: "floppy", cpu: cpu, ram: "ddr"}
Uncaught ReferenceError: computer is not defined
When we write var or let or const we are declaring variables. In your case, you just write:
computer = { ...
The error is telling you quite clearly that you haven't defined a variable called that, or it can't find one. This is a simple fix:
var computer = {
As a sidenote, notice that above when declaring a variable it is correct to use an equals sign, but when you are in an {} object, you should always use colons.
letorvar–let computer = {drive ...if you intend to make a change to the variable later oncpu = "intel"which should becpu: "intel"– that is the invalid shorthand