We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6 Template Strings & Tags
"use strict"; /** * * @author xgqfrms * @license MIT * @copyright * @description Tagged Template Literals & ES6 Template Literals/ ES6 Template Strings * @augments * @example * @param {*} strings * @param {*} name * @param {*} age * */ const highlight = (strings, name, age) => { return ` <div> <p> ${strings[0]}: <span style="color: #0f0; background: #000;">${name}</span>, ${strings[1]}: <span style="color: #0f0; background: #000;">${age}</span>, ${strings[2]}. </p> </div> `; }; let name = "xgqfrms", age = 23, sentence = highlight`My name is ${name} and ${age} years old.`; console.log(sentence); const body = document.querySelector("body"); body.innerHTML = ""; body.insertAdjacentHTML("beforeend", sentence);
The text was updated successfully, but these errors were encountered:
"use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @description Tagged Template Literals & ES6 Template Literals/ ES6 Template Strings * @augments ES6 Template Strings & Tags * @example ... * @param {*} strings * @param {*} name * @param {*} age * @reference https://wesbos.com/tagged-template-literals/ * */ const highlight = (strings, name, age) => { return ` <div> <p> ${strings[0]}: <span style="color: #0f0; background: #000;">${name}</span>, ${strings[1]}: <span style="color: #0f0; background: #000;">${age}</span>, ${strings[2]}. </p> </div> `; }; let name = "xgqfrms", age = 23, sentence = highlight`My name is ${name} and ${age} years old.`; console.log(sentence); const body = document.querySelector("body"); body.innerHTML = ""; body.insertAdjacentHTML("beforeend", sentence);
Sorry, something went wrong.
No branches or pull requests
Tagged Template Literals & ES6 Template Literals/ ES6 Template Strings
The text was updated successfully, but these errors were encountered: