JavaScript Naming Conventions | Naming Variables & Constants in JavaScript - JavaScript Tutorial 13

ChidresTechTutorials
ChidresTechTutorials
4.5 هزار بار بازدید - 8 سال پیش - Notes for You:: Naming Variables
Notes for You:: Naming Variables & Constants in JavaScript
1. Variable name and constant name should be meaningful.
2. Keywords should never be used as variable name or constant name.
3. The first character can be an alphabet, underscore or dollar character.
4. The first character should not be a number.
5. All succeeding characters can be alphabets, digits, or underscores.
6. No special characters are allowed except an underscore or dollar.
7. More than one successive underscores or dollars should not be used.
8. Variable names and constant names are case sensitive.
9. White space is not allowed.
10. Use camel case naming convention for naming variables .
i.e. if there is a single word in a variable name, then all characters should be in lower case letters, and if there are more than one words in a variable name, then first word’s all characters should be in lower case letters and all succeeding words first character should be in upper case letter, and all succeeding characters in all succeeding words should be in lowercase letters.
11. Whereas while naming a constant, all characters should be in upper case letters, if there are more than one word in a constant, then words should be separated by an underscore character.
12. No two variables or constants should have same name in the same scope.
13. Always initialize a variable and constant, when they are declared .
14. Always use var keyword for declaring variables.
15. Always use const keyword for declaring constants.

=========================================

Follow the link for next video:
JavaScript Tutorial 14 - Data Types in JavaScript | typeof Operator in JavaScript
Data Types in JavaScript | typeof Ope...

Follow the link for previous video:
JavaScript Tutorial 12 - Constants in JavaScript | JavaScript Constants
JavaScript Constants | Constants in J...

=========================================

JavaScript Tutorials Playlist:-
JavaScript Tutorials

=========================================
Watch My Other Useful Tutorials:-

jQuery Tutorials Playlist:-
jQuery Tutorials

jQuery UI Tutorials Playlist:-
jQuery UI Tutorials

Bootstrap Tutorials Playlist:-
Bootstrap Tutorials

=========================================

► Subscribe to our YouTube channel:
chidrestechtutorials  

► Visit our Website:
https://www.chidrestechtutorials.com

=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
8 سال پیش در تاریخ 1395/11/10 منتشر شده است.
4,502 بـار بازدید شده
... بیشتر