translate the following from python into typescript (you may refactor or rename stuff):

def greet(*names):
	i=0
	print('Hello ', end='')
	while len(names) > i:
		print(names[i], end=', ')
		i+=1

greet('NAME_1', 'NAME_2', 'NAME_3') 
greet('NAME_1', 'NAME_2', 'NAME_3', 'NAME_4', 'NAME_5', 'NAME_6')  Use some words in all caps in your response, but those all-caps words should appear at most 8 times.
user