Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

<!

DOCTYPE html>
<html lang="en">
<head>

<title>Dates</title>
</head>
<body>
<p>This page explains name split and format change.</p>
<p>we start by setting up an input variable called fullname</p>
<p> we console.log it by adding 'Name being processed :' before so it displays the
input </p>
<p>Then we set a first function to split with a variable using indexof </p>
<p>to get the index of the space between the first and the last name</p>
<p>then we use slice to split the full name to two parts, first and the last
name</p>
<p>afer we get the two constants defined it becomes easy to return the result</p>
<p>in different format (reversed and greeting) by using two other functions</p>
<p>Then we change the input from one name to an array of names</p>
<p>so we use foreach on the input array , then we consol.log each function</p>

<script src =name.js></script>


</body>
</html>

You might also like