How to iterate the installed fonts using javascript?
To start off, you might want to check what fonts are installed on the client. Read up on http://www.lalit.org/lab/javascript-css-font-detect
You need to have your own list of fonts to check, then you have an array of installed fonts by checking each of the list to see which one is installed.
There's not a way that I'm aware of. There are system APIs in languages like C++ and Python that will return the installed fonts, and you can certainly write a backend in a higher level language that communicates with a JavaScript front end using get/post requests and (optionally) AJAX, but you're not going to get the installed fonts with only JavaScript.
Javascript's sandboxed inside the browser and doesn't have privileges to read from the clients disk for security reasons.
However people tried making some workarounds like http://www.lalit.org/lab/javascript-css-font-detect or http://remysharp.com/2008/07/08/how-to-detect-if-a-font-is-installed-only-using-javascript/.