Some Important JavaScript topics

Rahad Ahmed
3 min readMay 6, 2021

Syntax, Comments

  1. Syntax: What the name of all things of a javascript function. Everything is in the picture;

2. Comments: If we want to hide any word or line, we can comments it. Example:
function showPrimes(n) {
nextPrime: for (let i = 2; i < n; i++) {
// check if i is a prime number for (comments)
(let j = 2; j < i; j++) {
if (i % j == 0) continue nextPrime; } alert(i); } }

3. Caching: Caching is a general computer concept that provides efficiency through data availability. The mechanism by which this is accomplished is through the storage of commonly accessed data in several places, and then serving that data to requesters from the common data store.

4. charAt(): It returns the specific index or position of each character in the string. This means that you can find out the position of any character in the string with this method.

5. Concat()-The function of this method is to add one or more strings and return a new string.

6. Includes(): The method determines whether a string contains the characters of a specified string. If the characters are in the string, True returns otherwise false;

7. EndsWith()- the includes() method determines whether a string ends with the characters of a specified string. If the characters are at the end of the string, True returns otherwise false;

8. Trim()-Removes white space on both sides of the string.

9. TrimEnd()-Removes the white space on the right side of the string

10. TrimStart()- Removes the white space on the left side of the string

--

--