- 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);
Result
Goalscompleted
- Add the
getDescription
method, which returns the'computer'
line, to thecomputer
object. - Instead of logging variable
myComputer
in the console, log message'In the cart ' + myComputer.getDescription()
.
Comments