Add js depend jQuery in a specific content type I need to add js file with jQuery syntax on a specific content type.

I tried on twig template but I get jQuery or $ not a function,

If I have js native syntax only, it is working great but not with jQuery syntax.

I think that this is not the right way to add a js depend jQuery file to a specific page.

I an wondering, What is the right way to do it?

Thanks a lot.
Checkout https://www.drupal.org/docs/8/creating-custom-modules/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-module especially section Attaching a library in a twig template

See also lib/Drupal/Core/Render/theme.api.php where the library is like $build['#attached']['library'][] = 'core/jquery';

{{ attach_library('core/jquery') }}