Javascript component helper