JavaScript Core Fundamental Concept (Part-1)
Hello Programmers! Hope you are doing well and keep learning. Today I’m gonna start to share with you some core fundamental concepts of JavaScript that we often use. Actually, this is my first blog. Every time I was a learner but today this is the first time I gonna start write something for you from my experience. So hope you guys take it positively.

String
In Every Programming Language, we use string to store text format data for code reusability. There are many useful operations in string, but today I want to discuss two code fundamental concept which is charAt and concat operation in string.
charAt: This operation is used to access an individual character in the string. The charAt() method returns the specific data in the string. For example-
const names = ‘Iqbal Ahmed’;
console.log(names.charAt(2));
Here charAt method starts searching that what’s the value at index 2? we all know that its start count from 0 then it’s find ‘b’ at index 2.
concat: String concatenation works to join two individual strings in one string. concat() method always returns a new string. For Example-
const firstName = ‘Iqbal ’;
const lastName = ‘Ahmed’;
const result = firstName.concat(lastName)
So the output will show ‘Iqbal Ahmed’.
Not only two you can join three or more as you want like this way.
const str1 = ‘HTML ’;
const str2 = ‘CSS ’;
const str3 = ‘JavaScript’;
const result = str1.concat(str2, str3);
//exprected output: HTML CSS JavaScript
Number
In JavaScript, the Number use to represent and manipulate numbers like 30, 40.5, or -65. In JavaScript, the number type is a double-precision 64-bit value. It means it represents fractional value. Number(value) function is used to convert a string or other value to the number type data. When the value can’t be converted then it’s return NAN (Not A Number).
Now I start to discuss two popular number conversion which is parseFloat and parseInt in JavaScript.
parseFloat: The parseFloat function parses a string and returns to a floating-point number. Remember that it returns a number as a number if the first character in a specified string is a number then parse the string until the end of the number.
For example-
const number1 = parseFloat(“20.20”);
Here “20.20” is a string but when the parseFloat method work on it then its converts to 20.20 as a number value.
But if the program is like that-
const number2 = parseFloat(“I am 22”);
then the output will be NAN because it starts parsing from index 0 and the first value in the string is ‘I’ which is not a number then it’s return NAN.
parseInt: Like parseFloat, In JavaScript parseInt function parses the string and returns an integer number. If the first character in a string is can’t be converted to a number then it returns NAN.
Follow the program below-
const num1 = parseInt( “40”);
the output will be number 40. But if the program is like that
const num2 = parseInt(“The number is 40”) then the output will show NAN.
Array
An array is a special type of variable that can store more than one value. You can say an array is a basic data structure. If I say write a program which can store your 5 friends name then you declare 5 variables and store every single value but in array, you can declare only one variable and store 5 friends name in one variable.
Creating an array
const names = [‘Tangil’, ’Nahid’, ’Habib’, ‘Sayem’, ’Sayeed’];
Another way creating an array.
const names = new Array (‘Tangil’, ’Nahid’, ’Habib’, ‘Sayem’, ’Sayeed’);
Array Method
There are many methods in array but I’m discussing a few of them.
Push: Array push method is used for adding an item end of the array. Suppose I have a list where store some fruits name and now I want to insert another fruit name in the list then I need to use an array push method. See the program below-
let fruitsName = [‘banana’, ‘apple’, ‘orange’];
console.log(fruitsName.push(‘mango’));
then the list will be like this [‘banana’, ‘apple’, ‘orange’, ‘mango’];
Pop: Array pop method is used for removing the last element from an array. From the previous program, there are four fruits in the fruits array banana, apple, orange, and mango. If I want to remove the last element I need to use the pop method.
let fruitsName = [‘banana’, ‘apple’, ‘orange’, mango];
console.log(fruitsName.pop());
then the output will be banana, apple, orange. The last element mango removed from the list.
Shift: Array shift method removed the first element from an array, just reverse of pop method.
const num = [20,30,40];
const newArray = num.shift())
console.log(num)
// expected output [30,40]
Unshift: Array unshift method add one or more item in the beginning part of an array.
const numbers = [23,43,56,76];
console.log(numbers.unshift(10,15));
// expected output 15
console.log(numbers)
// expected output 10,15,23,43,56,76
Find: Array find method return the first value from the satisfied condition. We often use find for searching implementation.
const numbers = [10, 20, 30, 40., 50];
const res = array.find(number => number > 15);
// expected output 20
Filter: Array filter method create a new array from the satisfied condition. Array find method return only first value but filter method return all of the satisfied value.
const numbers = [10, 20, 30, 40., 50];
const res = array.filter(number => number > 15);
// expected output 20,30,40,50
So this is for today. Hope you guys understand. Keep Learning!!
Thank You♥️