How to configure w=1 and j=1 by default I am new to Mongodb and I would like to confirm my configuration of write concern with majority and journal are correct.

I have three mongodb nodes: 

1) In the mongo.conf of all mongodb servers, i added

storage:
    journal: enabled: true


2) in the mongodb shell, i entered

cfg = rs.conf()
cfg.settings.getLastErrorDefaults = {w: 1, j: true}
rs.reconfig(cfg)


Am I correct? 

if yes, my second question is, what is the purpose of step 1 for?

Thanks
Yes, you have done correct steps to configure default write concern settings.
What comes to the second question, as it is written here at the documentation:

WiredTiger uses checkpoints to provide a consistent view of data on disk and allow MongoDB to recover from the last checkpoint. However, if MongoDB exits unexpectedly in between checkpoints, journaling is required to recover information that occurred after the last checkpoint.
With journaling, the recovery process:

Looks in the data files to find the identifier of the last checkpoint.
Searches in the journal files for the record that matches the
identifier of the last checkpoint.
Apply the operations in the journal files since the last checkpoint.