homework-6(functional JS)