const util = require(
'util'
);
let unboxedString =
"GeeksforGeeks"
;
console.log(
"Value:"
, unboxedString);
isBoxed = util.types.isBoxedPrimitive(unboxedString);
console.log(
"Value is a boxed primitive:"
, isBoxed);
let boxedString =
new
String(
"GeeksforGeeks"
);
console.log(
"Value:"
, boxedString);
isBoxed = util.types.isBoxedPrimitive(boxedString);
console.log(
"Value is a boxed primitive:"
, isBoxed);
let unboxedInteger = 99;
console.log(
"Value:"
, unboxedInteger);
isBoxed = util.types.isBoxedPrimitive(unboxedInteger);
console.log(
"Value is a boxed primitive:"
, isBoxed);
let boxedInt =
new
Number(99);
console.log(
"Value:"
, boxedInt);
isBoxed = util.types.isBoxedPrimitive(boxedInt);
console.log(
"Value is a boxed primitive:"
, isBoxed);
let unboxedBool =
false
;
console.log(
"Value:"
, unboxedBool);
isBoxed = util.types.isBoxedPrimitive(unboxedBool);
console.log(
"Value is a boxed primitive:"
, isBoxed);
let boxedBool =
new
Boolean(
false
);
console.log(
"Value:"
, boxedBool);
isBoxed = util.types.isBoxedPrimitive(boxedBool);
console.log(
"Value is a boxed primitive:"
, isBoxed);