JS
challenger
Home
JavaScript Basics
strings
Compare Strings with Different Quotes
Compare Strings with Different Quotes
Assign a string to two different variables: one using single quotes and one using double quotes. Then, check if these variables are equal using the === operator.
reset
let str1 = ; let str2 = ;
const areEqual = str1 === str2; console.log(str1 === str2); // expected output: true
JavaScript
Run Code
Console