Javascript Data Type Question Append boolean and number to String

Introduction

What is the output of the following code.

// add a boolean to a string
var boolValue = true;
var strngValue = "The value is " + boolValue; 
console.log(strngValue);

// add a number to a string
var numValue = 3.0;
strngValue = "The value is " + numValue;
console.log(strngValue);


The value is 3
The value is true



PreviousNext

Related