functions js sample