How to use a function to greet a person in JavaScript

Hello so my question is about this assignment and how I am stuck on how to proceed with getting the persons name to be added to the greeting. The assignment directions are as follows:
Create a function called greet that has one parameter called name and does not return a value. When greet is called, it should say hello to the value passed in as the argument to name. For instance, greet(“Bob”); should print out Hello, Bob!

Create a function to greet a person and return their name.

var greet_name = function(person_name, greet) {
  var text = greet + ',' + name;
  var person_name = text
  text = "Enter your name here";
  person_name = prompt(text); stop 

  var greet = greet_name(person_name, greet);

Some advice on what the next steps would be great or just suggestions on places to edit the code.


24 thoughts on “How to use a function to greet a person in JavaScript”

  1. 215806 629324A person necessarily lend a hand to make severely posts Id state. This really is the quite 1st time I frequented your web page and to this point? I surprised with the analysis you created to make this certain submit extraordinary. Magnificent approach! 208983


Leave a Comment