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
console.log(text);
var greet = greet_name(person_name, greet);
};
greet_name()
Some advice on what the next steps would be great or just suggestions on places to edit the code.
Thanks
Okay, so we only need one parameter for the function:
function greet(name){
And We know that we don’t need to have the function return anything, but it needs to print out the name:
console.log("Hello, " + name);
Additionally, we want a prompt so the user can enter a name of their choice. We can actually do this during the function call:greet(prompt("Enter Name:"))
Thus, we have a fully functional greeter. Final product:function greet(name){
console.log("Hello, "+ name);
}
greet(prompt("Enter Name:"));
Try This
This Might be an easier and cleaner way to do it.
propecia webmd – keeps finasteride finasteride drug class
Wmmxyf – http://virviaga.com/ generic viagra names
Brokqd – clomid 100mg Hnjnvz yhkcbi
Wzurqc – viagra pills 100 mg Uennyx eseaki
Yqpouf – need help on essay Btnewn syvdag