Sunday, 7 May 2017

string in a string with template literals

i want to make a string in a string with a template literal in javascript ecma6. Is it possible to add the double or single quotes to the tamplate litaral output in the string. i came accross this problem using the output of a directory in a string from path as a string.

input = "C:\users\document"

i want to child.stdin.write('athom project --run "C:\users\document" \n')

i came to this child.stdin.write('athom project --run "' +${input}+ '"C:\users\document \n')

isnt there a neater way to do it in ecma6 ?



via wetlip

No comments:

Post a Comment