View Library code in Javascript and not TypeScript

I am new to using Web storm. While I wrote javascript code 

 

// Sort Array
arr1.sort(function (a, b) {
return a - b;
});

and i clicked on sort method to see its syntax, a typescript file opened - lib.es5.d.ts where syntax was shown in typescript.

 

/**
* Sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
sort(compareFn?: (a: T, b: T) => number): this;

 

But I wanted in javascript format just like shown in MDN javascript docs. How should I configure webstorm to see syntax code in javascript and not typescript ?

 

 

1 comment
Comment actions Permalink

Array.prototype.sort() is a part of javascript core, built-in APIs, there are no JavaScript libraries for it (if you are aware of any, you can download them and set up as a library in Webstorm to let the IDE use it when navigating to declaration).

Typescript API stubs (distributed by Microsoft) are used instead for completion/types hinting.

 

To view MDN-like docs for this method, hit Ctrl+Q (or whatever shortcut you have assigned to View | Quick Documentation):

 

0

Please sign in to leave a comment.