Javascript object basics constructors tutorial code examples seem to have redundant lines of code

on the page: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics

there are several references in the code examples for constructors, for example:

const salva = createPerson('Salva');
salva.name;
salva.introduceSelf();

const frankie = createPerson('Frankie');
frankie.name;
frankie.introduceSelf();

i’m confused about these lines:

salva.name;
and
frankie.name;

on lines by themselves - is this to initialise the object’s properties? it seems to run fine without these lines

it does go on to explain how to use constructors

am i missing something with these lines?

Hello @mozdevinitely

i think the purpose for the whole code that you run it on the console of your browser so you can see when you use salva.name it print the value of the name of the salva object

or maybe they meant to write console.log(salva.name);

hope that help and have a nice day :slight_smile:

1 Like

makes sense, thanks @justsomeone

you welcome @mozdevinitely :slight_smile: