tagged-templates Questions
3
Solved
I'm not sure how to explain this, but when I run
console.log`1`
In google chrome, I get output like
console.log`1`
VM12380:2 ["1", raw: Array[1]]
Why is the backtick calling the log function...
Conjurer asked 15/4, 2015 at 20:35
3
Solved
I understand the syntax of ES6 tagged templates. What I don't see is the practical usability. When is it better than passing an object parameter, like the settings in jQuery's AJAX? $.ajax('url', {...
Konopka asked 23/7, 2015 at 14:54
2
Solved
I have encounter this example and was completely lost...
const test = (hey) => console.log(hey);
console.log(test `wtf`);
First all this is valid, in the console.log, it appear to be
...
Pustulate asked 26/10, 2016 at 7:34
1
Solved
According to MDN, Tagged template literals can be used as follows:
var a = 5;
var b = 10;
function tag(strings, ...values) {
alert(strings[0]); // "Hello "
alert(strings[1]); // " ...
Pithy asked 23/3, 2016 at 0:41
1
Solved
I'm using tagged template strings in following code
var a = 5;
var b = 10;
var pp="";
function tag(strings, ...values) {
pp+=strings[0]; // "Hello "
pp+=strings[1]; // " world "
pp+=values[0]; ...
Magnanimity asked 14/10, 2015 at 12:36
1
Solved
After studying this Es6 tag template example:
var yo = func`${x} + ${y}\n= ${x + y}`;
one@public-node ~/es6 $ 6to5 tag.js
"use strict";
var _taggedTemplateLiteral = function (strings, raw) {...
Wean asked 5/1, 2015 at 15:25
1
© 2022 - 2024 — McMap. All rights reserved.