locked
is there generics in javascript? RRS feed

  • Question

  • User1034446946 posted

    hi

    When i use 3rd party sites the intellisense in visual studio code often shows someFunction <any, any>(value1, value2)

    I am assuming thats like generics in c#

    Saturday, November 9, 2019 11:16 PM

Answers

  • User-474980206 posted

    No, but the intellisense is for typescript. It’s assumed the typing information is handy. JavaScript libraries can supply typings to make them more useful to typescript or the intellisese. As visual studio code is by far the most popular JavaScript code editor, and supports this by default, it’s popular.

    Another common typeIng system for JavaScript Is flow.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 10, 2019 5:59 PM
  • User288213138 posted

    Hi EnenDaveyBoy,

    is there generics in javascript?

    Here a article about JavaScript generic type pattern implementation.

    https://www.codeproject.com/Articles/38909/A-simple-JavaScript-generic-type-pattern-implement

    the intellisense in visual studio code often shows someFunction

    The IntelliSense gives both inferred proposals and the global identifiers of the project. The inferred symbols are presented first, followed by the global identifiers (shown by the document icon).

    More information about the intellisense in visual studio you can refer this link:

    https://code.visualstudio.com/docs/editor/intellisense

    Best regards,

    sam

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 11, 2019 10:06 AM

All replies

  • User-474980206 posted

    No, but the intellisense is for typescript. It’s assumed the typing information is handy. JavaScript libraries can supply typings to make them more useful to typescript or the intellisese. As visual studio code is by far the most popular JavaScript code editor, and supports this by default, it’s popular.

    Another common typeIng system for JavaScript Is flow.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 10, 2019 5:59 PM
  • User288213138 posted

    Hi EnenDaveyBoy,

    is there generics in javascript?

    Here a article about JavaScript generic type pattern implementation.

    https://www.codeproject.com/Articles/38909/A-simple-JavaScript-generic-type-pattern-implement

    the intellisense in visual studio code often shows someFunction

    The IntelliSense gives both inferred proposals and the global identifiers of the project. The inferred symbols are presented first, followed by the global identifiers (shown by the document icon).

    More information about the intellisense in visual studio you can refer this link:

    https://code.visualstudio.com/docs/editor/intellisense

    Best regards,

    sam

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 11, 2019 10:06 AM
  • User1034446946 posted

    thanks for the info

    Monday, November 11, 2019 12:24 PM