Make a Person


problem explanation

In this problem


we define variable fullName that holds value of person function’s firstAndLast .then in setFullName equals to function that passes argument then we return if that passes argument as first name we pass fullName that equals to that passed name plus space and plus fullName’ split by space second(1)part.if it passes argument fullName then we have to return fullName that equals to input(name).then if it passes argument lastName we have to return fullName that equals fullName’ split by space first part (0) plus space and plus name(lastName)


in getFirstName we should return names first do that we have to return fullName split by space’s 1 (0) part.for lastName we split it by space and return its second(1) getFullName we return fullName.

that was all bye !





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Under The Sea with Parallax.js (Beginner Friendly)

Design Tokens in a React Component Design System — The Right Way

Waiting for a response from non-blocking API from Node JS

Testing React-app with Jest

How to Create a Responsive Flexbox Grid

React Hooks: Why We should Embrace it

CSS Grid vs Flexbox

How to configure jest with enzyme

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store