Update script.js

extract and sort