Basic Concept of JavaScript for Very Beginners

Mahabub Sunny
5 min readMay 5, 2021
Basic Concept of JavaScript for Very Beginners

Introduction of JavaScript: Nowadays JavaScript is a famous and most used programming language. It’s become famous every day but the actual question is what is JavaScript? Well, the answer is simple but quite complicated at least for me. JavaScript is a scripting or programming language that allows you to implement complex features on web pages it means displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc it’s possible because of JavaScript. Okay, enough intro let’s start learning something using JavaScript.

Any Programming Language has different types it calls something like building blocks, and JavaScript has also so many types, today we are discussing basic String, Numbers, and array.

String: JavaScript String has also so many different values. Let’s talk about some.

Example:
1. string();
2. concat();
3. includes();
4. replace();
5. slice();
6. splice();
7. startWith();

  1. string(); We know JavaScript has a string but how to write an string in JavaScript! It’s very simple.
Different types of String

inside of a Quotation, everything considers as a string.

2. Concat(); method concatenates strings arguments to the calling string and returns a new string. You can concatenate any string with another without affecting the other. It helps join multiple strings from different variables.

Concat String

3. Includes(); method search for value you provided and it performs a case-sensitive search. It checks for the word or something you provide. If the provided word is found in the sentence then it tells us with an index number but makes sure provided word and sentient text in the same format it mean case-sensitive form.

Check for word and include new.

4. Replace(); method returns a new string with some or all matches of the pattern replace with provided value or replacement. The pattern can be a string or RegExp (Regular Expression). If you write some string and need to change some word or something you can use the replace method this method will find the string for you and replace the value with your one. It was very effective.

Find and replace

5. Slice(); a method used to cut or take a specific part of a string. Slice extracts a section of a string and returns it as a new string without modifying the original one. It is useful when you need a specific part only for example “I Love JavaScript” is a full sentence but you need only the “JavaScript” word. At this moment you can simply slice it without modifying the original one.

Slice Specific Part

6. startWith(); is a method checks string starting letter or words. startWith method determines whether a string begins with the characters of a specified string, returning true or false as appropriate. This method lets you determine whether or not a string begins with another string. This method is case-sensitive.

Check Starting

Ok enough, Now time to talk about Numbers. We are discussing some value of JavaScript numbers.

Example:
1. isNaN()
2. parseFloat()
3. parseInt()

1. isNaN() method determines whether the passed value is NaN and its type is Number. It is a more robust version of the original, global isNaN().
Due to both equality operators, == and ===, evaluating to false when checking if NaN is NaN, the function Number.isNaN() has become necessary. This situation is unlike all other possible value comparisons in JavaScript.

In comparison to the global isNaN() function, Number.isNaN() doesn’t suffer the problem of forcefully converting the parameter to a number. This means it is now safe to pass values that would normally convert to NaN, but aren’t actually the same value as NaN. This also means that only values of the type number, which are also NaN, return true.

isNaN

2. parseFloat() method parses an argument and returns a floating-point number. If a number cannot be parsed from the argument, it returns NaN. The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. Leading whitespace in this argument is ignored.

ParseFloat

3. parseInt() method parses a string argument and returns an integer of the specified radix or base. The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. Leading whitespace in this argument is ignored.

ParseInt

All About JavaScript Arrays, Today we are discussing two methods or functions.

Example:

  1. Shift();

2. unshift();

  1. Shift(); the method is used in an array to remove something inside an array. It removes the first element from an array. When call shift(); this method will remove something from an array from the very beginning of the first element index 0 positions will be removed.
Array Shift

2. unshift(); the method is used to push or adds one or multiple elements inside an array. When unshift method is called it pushes an element at index position 0, it always pushes in the first position, and another same method is a push(); it adds elements at the last of the array, and unshift is used for adding in the first position.

Array — UnSfit

Thank you for reading.. 😊

--

--