JSFiddle - React, Tailwind, and code Playground
by Ismail RBOUH
HTML
Inspect this in the console!
<script id="myJSONID" type="application/ld+json">
</script>
JavaScript
var myList = [];
function buildMyList() {
return ["2 items", "3items", "so on"];
}
$("#myJSONID").text(function() {
return JSON.stringify({
"@context": "http://schema.org/",
"@type": "Recipe",
"recipeIngredients": buildMyList()
});
});