Interactive online courses HTML Academy
2026-03-09 12:55 Diff
  • script.js

JavaScript

var buildComputer = function (memory, display, processor) { var computer = { basicPrice: 5000, processor: processor, display: display, memory: memory }; return computer; }; var myComputer = buildComputer(8, 13, 'i7'); console.log(myComputer);

Thanks! We’ll fix everything at once!

Result

  1. Add the getDescription method, which returns the 'computer' line, to the computer object.
  2. Instead of logging variable myComputer in the console, log message 'In the cart ' + myComputer.getDescription().