function greet(name) {
	// extract first name, to be casual and *cool*
	var spl = name.split(' ');
	name = spl.length > 0 ? spl[0] : name;

	// possible greetings
	var greetings = [
		"Hey %!",
		"Heyo %!",
		"What's up %!",
		"What's poppin' %!"
	];

	// choose a random greeting and fill in the name
	return greetings[Math.floor(Math.random() * greetings.length)].replace('%', name);
}
// generate a fun and exciting greeting, given a name
generate a fun and exciting greeting, given a name
generate a fun and exciting greeting given a name
function greet(name) {
	var spl = name.split(' ');
	name = spl.length > 0 ? spl[0] : name;
	var greetings = [
		"Hey %!",
		"Heyo %!",
		"What's up %!",
		"What's poppin' %!"
	];
	return greetings[Math.floor(Math.random() * greetings.length)].replace('%', name);
}
function greet ( name ) { var spl = name . split ( ' ' ) ; name = spl . length > 0 ? spl [ 0 ] : name ; var greetings = [ "Hey %!" , "Heyo %!" , "What's up %!" , "What's poppin' %!" ] ; return greetings [ Math . floor ( Math . random ( ) * greetings . length ) ] . replace ( '%' , name ) ; }
generate a fun and exciting greeting, given a name
generate a fun and exciting greeting given a name
// extract first name, to be casual and *cool* // possible greetings // choose a random greeting and fill in the name