p42ai / js-assistant

120+ refactorings and code-assists for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=p42ai.refactor
MIT License
119 stars 7 forks source link

Refactoring Idea: new Array<T> to :T[] = []; #24

Closed hediet closed 1 year ago

hediet commented 2 years ago
const arr = new Array<T>();

<->

const arr: T[] = [];

The second one is faster (by 5-10%).

lgrammel commented 2 years ago

Thanks, great suggestion!

lgrammel commented 1 year ago

I've just released v1.121.0, which adds this refactoring. Thanks for the idea!

action-convert-new-array-to-array-literal