can we use let firstName=name.split(" “) in place of firstName=name.split(” ")[0]
Webinar 07: Sort, Map, Reduce, Filter in Arrays
yes you can add let keyword, no problem, but if you are asking whether to put [0] this or not, you have to because after splitting there will be two elements and the first one indexed 0 is the first name
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.