I'd like to ask you the difference between JavaScript and...

Asked 2 years ago, Updated 2 years ago, 48 views

 var list =`<ul>`;
                for(var i=0;i<filelist.length;i++){
                    list = list + `<li>${filelist[i]}</li>`
                }
            list = list + `</ul>`

In the code above, I wrapped the ul tag with a dot (?) on the left side of keyboard number 1, and a compilation error appears Why can't you wrap it up? ' Is there any reason to cover it with?

javascript node.js

2022-09-22 13:48

2 Answers

Hello, everyone

I'm a beginner too, but... It's supposed to be a quotation mark (because it's a string.


is called Template Strings

const name = 'Nate'
const address = 'Seoul'

console.log(`${name} in ${address}`)

It's used like this!


2022-09-22 13:48

Another characteristic is When you make a multi-line string, it's made exactly as you wrote it.

let a = 'hello\nworld'; // single quotation
let b = `hello
world`; // backtick

// Both
// // "hello
// // world"


2022-09-22 13:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.