๐ ๐ฎ๐๐๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐๐ป๐ฐ๐๐ถ๐ผ๐ป๐: ๐๐ ๐ฃ๐ฅ๐ข๐ฉ๐๐ก๐ ๐๐ข๐๐
You want to convert a string to Camel Case in JavaScript. Camel Case is a style where the first word starts with a lowercase letter and each subsequent word starts with an uppercase letter. This style is used to name variables and functions in JavaScript.
Functions in JavaScript are blocks of code that perform specific tasks. They help you organize and reuse code. Functions can take inputs, perform actions, and return outputs.
- They make your code more modular
- They help you avoid repeating code
- They make your code easier to read
The return statement sends a result back from a function. When the return statement executes, the function stops running. You can store the returned value in a variable or use it directly.
JavaScript has a behavior called Hoisting. Hoisting moves variable and function declarations to the top of their scope. This can lead to surprising results.
- Declarations are hoisted
- Initialisations are not hoisted
- 'var' variables are hoisted with undefined
Source: https://dev.to/karthick_07/mastering-functions-unleashing-the-power-of-code-5gka