js advanced functions ex 2