javascript return value if not null