JavaScript 2022

Term 3 Wednesday

May - July 2022

This site will be updated live during the sessions

Week 3 Functions

		
001function joinNames(fn, ln)
		
002{
		
003	let fullname = fn + ' ' + ln;
		
004	return fullname;
		
005}
		
006
		
007let student1 = joinNames('Wai','Sung');
		
008let student2 = joinNames('Rory','Mclaren');
		
009let student3 = joinNames('Hollie','Fitzpatrick');
		
010
		
011//console.log(fullname);  // not defined as only exists in function
		
012
		
013console.log(student1);
		
014console.log(student2);
		
015console.log(student3);
		
016
		
017const joinWords = (str1,str2) => { return str1 +' '+ str2};
		
018
		
019let tutor = joinWords('Toby', 'Brodie');
		
020console.log(tutor);