Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript Create Strings

//strings example
const name = 'Peter';
const name1 = "Jack";
const result = `The names are ${name} and ${name1}`;
Comment

Javascript Create Strings

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Strings</h2>

<p>You can use quotes inside a string, as long as they don't match the quotes surrounding the string:</p>

<p id="demo"></p>

<script>
var answer1 = "It's alright";
var answer2 = "He is called 'Johnny'";
var answer3 = 'He is called "Johnny"';

document.getElementById("demo").innerHTML =
answer1 + "<br>" + 
answer2 + "<br>" + 
answer3;
</script>

</body>
</html>
Comment

how to make a string in javascript

//In Javascript, a string can be declared using "" or ''.
Comment

PREVIOUS NEXT
Code Example
Javascript :: variables javascript 
Javascript :: js jwt decode 
Javascript :: then and catch in promise 
Javascript :: math.floor 
Javascript :: jquery works until modal is shown 
Javascript :: set id to div element in Javascript 
Javascript :: regex for not accepting zeros 
Javascript :: get channel object using its name discod.js 
Javascript :: findoneandupdate mongoose 
Javascript :: onclick node js 
Javascript :: react tailwind loading 
Javascript :: check if array contain the all element javascript 
Javascript :: selected text 
Javascript :: Adding A forEach Function To An HTMLCollection JavaScript 
Javascript :: byte number to array js 
Javascript :: how to upload image in react js 
Javascript :: vue cli debugger 
Javascript :: write hover animation for styled div 
Javascript :: delete last array element javascript 
Javascript :: get textarea value jquery 
Javascript :: how to handle errors with xmlhttprequest 
Javascript :: mongodb add 1 to field 
Javascript :: date and time javascript 
Javascript :: props comment 
Javascript :: create or update in sequelize 
Javascript :: Find the longest string from a given array 
Javascript :: greater than x but less than y js 
Javascript :: xmlhttprequest status codes 
Javascript :: jquery call a class 
Javascript :: how to make a circle in p5js 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =