javascriptodataazure-table-storageazure-tablequeryazure-sdk-js

Calling a JS function without parentheses?


How the following code makes a call to odata function, is this a new language feature? what is the name of this new language feature and where can I find its reference?:

const { odata, TableClient } = require("@azure/data-tables");
const priceListResults = client.listEntities({
    queryOptions: { filter: odata`price le 6` }
  });

Btw, I copied the above piece of code from here: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/tables/data-tables/samples/v12/javascript/queryEntities.js


Solution

  • it's Tagged Templates, you can check it out at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates