Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make IntelliJ order javascript object properties by name in the watch window?

I am debugging a javascript application. Please, observe a snapshot of the watch window:

enter image description here

Note, that the properties are displayed in what appears a total mess. It is probably their natural order, but when there are lots of them it becomes really annoying. Is it possible to order them?

Thanks.

like image 619
mark Avatar asked Aug 23 '12 11:08

mark


People also ask

Are JavaScript object properties Order?

YES (but not always insertion order). Most Browsers iterate object properties as: Integer keys in ascending order (and strings like "1" that parse as ints) String keys, in insertion order (ES2015 guarantees this and all browsers comply)

Do JavaScript objects have order?

Comparing JavaScript Object Keys to Arrays To illustrate that JavaScript object keys are not ordered, let's compare them to an array: a simple list of items in a specific order. JavaScript arrays have a defined order from index 0 to the last item in the list, and items added to the array using .

How can you get the list of all properties in an object in JavaScript?

getOwnPropertyNames() The Object. getOwnPropertyNames() method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object.


1 Answers

Just press 'Sort values alphabetically' button:

enter image description here

like image 149
Nik Avatar answered Sep 28 '22 00:09

Nik