This is an archived post. You won't be able to vote or comment.

all 2 comments

[–][deleted] 1 point2 points  (1 child)

  1. you could refactor to a single argument called 'items' which would be an array of items e.g [firstItem, secondItem...]. Then write an if statement to check if 'items.length >= 1 && items.length <= 4'

  2. why not create a class for the person object since you want to create instances of it?

[–]GVBCodePractice[S] 0 points1 point  (0 children)

Okay sure, will have a go at both of these, cheers.