0

As Javascript is a dynamic typed langauge so how javaScript determines the data types ( of the variables)?

  • 1
    JavaScript is a dynamically typed language, which means that the data type of a variable is determined at runtime, not at compile-time. let x = 5; // x is a number let y = "hello"; // y is a string let z = x + y; // z is "5hello" (JavaScript coerces x to a string and concatenates it with y) JavaScript determines the data types of variables based on the data types of the values that are assigned to them, and it uses type coercion to automatically convert data types when necessary. – Ashutosh Kushawaha Mar 11 '23 at 08:08
  • This means Javascript determines the data types by looking at the values during the runtime? – Muhammad Faraz Ali Mar 11 '23 at 08:17
  • yes Javascript determines the data types by looking at the values during the runtime. – Ashutosh Kushawaha Mar 11 '23 at 12:29

0 Answers0