Implement a createTask in js