JavaScript – Miscellaneous concepts

  • You can declare Global variable without using var keyword, however, it is not recommended to use the Global variables.
  • Like all other programming languages, it is recommended to use CAML-casing nomenclature as first letter small and then for next word capital letter, e.g., salePerMonth. There should not be any space between the words.
  • End all the statements with semicolon (;) like we generally do in other programming languages. Multiple statements can be placed in one single line, separating them using semicolon.
  • There is no fixed datatype to be defined, it is always determined by the type of value assigned to the variable. But yes, we can determine the datatype of the variable using typeof For example: alert(typeof value). As in our example, value contains the string literal, it will show as string. For numbers, it will show number. Numbers are not mentioned in double quotes. If you mention numbers in double quotes, it will become string.
  • You can add 2 numbers using + sign, but in case of string it will concatenate two strings into one string.
  • alert function will not work without round parenthesis.
  • Single line comments are mentioned by using // in the beginning of that line. Multiple line comments start with /* and ends with */. Any statement within the comments will be ignored by JavaScript and will not be executed.
Power Platform Academy

Start or Upgrade your Career with Power Platform

Learn with Akanksha

Python | Azure | AI/ML | OpenAI | MLOps

Design a site like this with WordPress.com
Get started