documented js.close() and added it to all examples