example:datatypes.js


var prodid=1000;

var prodname="samsung";

var prodprice=50000;

var available=true;

console.log(prodid,prodname,prodprice,available);

price="dell";

console.log(price);


price=50000----->number------>//accepted

price="dell"------>string---->//accepted

In Javascript, the datatype is not fixed to one type, based on the value the datatype will be changing which is very dangerous in programming.

In other languages it will through an error where as in javascript will accept the value whatever you give it.

Javascript does not provide typesafety.