DEV Community

Tejkumar Kempaiah
Tejkumar Kempaiah

Posted on • Updated on

🔥 Naming conventions of JavaScript Functions

☑️Function names should start with a character
☑️Function names should be a verb/actions
Ex: getUser(), listUsers(), totalCars(), calculateArea()
☑️Just like in Java, functions are methods which ends with () and starts with smallCase and follow camelCasing
☑️A function can be declared in 2 ways.
☑️. Function expression
☑️. Function declaration
☑️Function can accept arugments like variables, objects, arrays and another function.
Note: Function accepting another function ---> This concept is called call back function in Javascript
☑️. A function can return or not return any type(data)
☑️. typeof keyword is used to find the recieved data type for a function
☑️. Function invoking with in same JS files
☑️. Function invoking within different JS files
☑️. One function should perform one task and the name of the function should be the purpose of that function
☑️. Functions are created with an intension of code re-usability

Top comments (0)