Updated with JS example.