JSOM Retrieve all list fields

You can use the following code to retrieve list field details

CODE