Decoding string and number operations

Report a typo

Consider the following JavaScript program:

/* A simple JavaScript program */
let item1 = '12';
let item2 = '5';
let totalString = item1 + item2;
let totalNumber = Number(item1) + Number(item2);
/* Prints the string and number totals */
console.log(totalString);
console.log(totalNumber);

What are the data types and values of the variables 'totalString' and 'totalNumber', and what are the two outputs of this program?

Select one option from the list
___

Create a free account to access the full topic