- 109
- 3 200
SmituCodes
เข้าร่วมเมื่อ 19 ธ.ค. 2016
SHIFT AND UNSHIFT IN JAVASCRIPT
In JavaScript, shift and unshift are methods used to add or remove elements from the beginning of an array.
1. Unshift
The unshift method adds one or more elements to the beginning of the array.
This increases the array's length.
It returns the new length of the array.
Example:
javascript
Copy code
let fruits = ["apple", "banana"];
fruits.unshift("orange"); // Adds "orange" to the beginning
console.log(fruits); // Output: ["orange", "apple", "banana"]
2. Shift
The shift method removes the first element from the array.
This decreases the array's length.
It returns the removed element.
Example:
javascript
Copy code
let fruits = ["orange", "apple", "banana"];
let removed = fruits.shift(); // Removes the first element ("orange")
console.log(fruits); // Output: ["apple", "banana"]
console.log(removed); // Output: "orange"
Key Points
Unshift adds elements to the beginning of an array.
Shift removes the first element of an array.
Both shift and unshift modify the original array...#learnhtml5andcss3#codingchallenge #code #webdevelopment #codewithme #codewithharry #frontenddevelopment#codewithharry #education #htmlacademy #htmlcss #css #codehelp #js #upsc #java #codewithharry #frontenddeveloper #javaprogramming #javatutorial #javatutorialsforbeginners #designer #design #engineering #CodingTutorial #CodeWithMe #ProgrammingTips #DeveloperLife#udemy #figma #TechTips #CodingJourney #CodeChallenge #JavaScript#Python #Java #CSharp#Ruby #PHP #TypeScript #WebDevelopment#WebDevelopment
#LearnWebDev
#CodeWithMe
#FrontendDevelopment
#WebDesign
#JavaScriptTutorial
#HTMLCSS
#CodingForBeginners
#FullStackDev
#WebDevelopmentCourse
#DeveloperTips
#CodingBootcamp #BackendDevelopment#codewithharry #code withharry #FrontendDevelopment #FullStack, #APIs #DatabaseDesign#OOP (Object-Oriented Programming),
#DataStructures #Algorithms#React #NodeJS#Django #Flask#Express, #Angular#VueJS #GraphQL#NextJS #Laravel#SpringBoot #Git#GitHub#Docker #Kubernetes#AWS #Azure#GCP#VSCode #CodingTutorial #CodeWithMe #ProgrammingTips #DeveloperLife #TechTips #CodingJourney #CodeChallenge #viral #viralvideos #youtube #youtubers #codewithharryHashtags: #CSDojo #CodingInterviews #ProgrammingHashtags: #freeCodeCamp #Coding #LearnToCode#codewithharry#codewithherry #shraddhakapra#codingblocks#programminglanguage #codenewbie #coding #earn #freelance #clanguage#codingjourney#WebDevelopment
#FrontendDevelopment
#BackendDevelopment
#FullStackDeveloper
#CodingTutorial
#JavaScript
#LearnToCode
#HTML
#CSS
#ReactJS
#NodeJS
#WebDesign
#CodingForBeginners
#Programming
#TechEducation
#CodeNewbie
#WebDevCommunity
#WebDesignTutorial
#JavaScriptTutorial
#DeveloperLife
#HTMLCSS
#WebDevelopmentTips
#CodingBootcamp
#WebDev
#CodingLife
#LearnWebDevelopment
#TechSkills
#ProgrammingForBeginners
#CodeWithMe
#Python
#APIIntegration
#ResponsiveDesign
#CodingJourney
#UXDesign
#UIUX
#PortfolioProjects
#WebDevTips
#WebApp
#HTML5
#CSS3
#WebDevBootcamp
#SoftwareEngineer
#ProgrammingLanguages
#TechTutorial
#LearningToCode
#DevTools
#DeveloperCommunity
#WebProjects
#WebDevelopmentCourse
#Code
1. Unshift
The unshift method adds one or more elements to the beginning of the array.
This increases the array's length.
It returns the new length of the array.
Example:
javascript
Copy code
let fruits = ["apple", "banana"];
fruits.unshift("orange"); // Adds "orange" to the beginning
console.log(fruits); // Output: ["orange", "apple", "banana"]
2. Shift
The shift method removes the first element from the array.
This decreases the array's length.
It returns the removed element.
Example:
javascript
Copy code
let fruits = ["orange", "apple", "banana"];
let removed = fruits.shift(); // Removes the first element ("orange")
console.log(fruits); // Output: ["apple", "banana"]
console.log(removed); // Output: "orange"
Key Points
Unshift adds elements to the beginning of an array.
Shift removes the first element of an array.
Both shift and unshift modify the original array...#learnhtml5andcss3#codingchallenge #code #webdevelopment #codewithme #codewithharry #frontenddevelopment#codewithharry #education #htmlacademy #htmlcss #css #codehelp #js #upsc #java #codewithharry #frontenddeveloper #javaprogramming #javatutorial #javatutorialsforbeginners #designer #design #engineering #CodingTutorial #CodeWithMe #ProgrammingTips #DeveloperLife#udemy #figma #TechTips #CodingJourney #CodeChallenge #JavaScript#Python #Java #CSharp#Ruby #PHP #TypeScript #WebDevelopment#WebDevelopment
#LearnWebDev
#CodeWithMe
#FrontendDevelopment
#WebDesign
#JavaScriptTutorial
#HTMLCSS
#CodingForBeginners
#FullStackDev
#WebDevelopmentCourse
#DeveloperTips
#CodingBootcamp #BackendDevelopment#codewithharry #code withharry #FrontendDevelopment #FullStack, #APIs #DatabaseDesign#OOP (Object-Oriented Programming),
#DataStructures #Algorithms#React #NodeJS#Django #Flask#Express, #Angular#VueJS #GraphQL#NextJS #Laravel#SpringBoot #Git#GitHub#Docker #Kubernetes#AWS #Azure#GCP#VSCode #CodingTutorial #CodeWithMe #ProgrammingTips #DeveloperLife #TechTips #CodingJourney #CodeChallenge #viral #viralvideos #youtube #youtubers #codewithharryHashtags: #CSDojo #CodingInterviews #ProgrammingHashtags: #freeCodeCamp #Coding #LearnToCode#codewithharry#codewithherry #shraddhakapra#codingblocks#programminglanguage #codenewbie #coding #earn #freelance #clanguage#codingjourney#WebDevelopment
#FrontendDevelopment
#BackendDevelopment
#FullStackDeveloper
#CodingTutorial
#JavaScript
#LearnToCode
#HTML
#CSS
#ReactJS
#NodeJS
#WebDesign
#CodingForBeginners
#Programming
#TechEducation
#CodeNewbie
#WebDevCommunity
#WebDesignTutorial
#JavaScriptTutorial
#DeveloperLife
#HTMLCSS
#WebDevelopmentTips
#CodingBootcamp
#WebDev
#CodingLife
#LearnWebDevelopment
#TechSkills
#ProgrammingForBeginners
#CodeWithMe
#Python
#APIIntegration
#ResponsiveDesign
#CodingJourney
#UXDesign
#UIUX
#PortfolioProjects
#WebDevTips
#WebApp
#HTML5
#CSS3
#WebDevBootcamp
#SoftwareEngineer
#ProgrammingLanguages
#TechTutorial
#LearningToCode
#DevTools
#DeveloperCommunity
#WebProjects
#WebDevelopmentCourse
#Code
มุมมอง: 19
วีดีโอ
POP & PUSH ELEMENT IN JAVASCRIPT
มุมมอง 1414 ชั่วโมงที่ผ่านมา
In programming, push and pop are common operations on arrays (or more specifically, stacks) that allow adding and removing elements. 1. Push The push operation adds an element to the end of the array. This increases the array's length by one. In JavaScript, you use the .push() method for this. Example in JavaScript: javascript Copy code let numbers = [1, 2, 3]; numbers.push(4); // Adds 4 to the...
SORT AND REVERSE ARRAY IN JAVASCRIPT
มุมมอง 232 ชั่วโมงที่ผ่านมา
In JavaScript, you can use the sort() and reverse() methods to sort and reverse an array. Here’s how you can do it: 1. Sort an Array The sort() method sorts the elements of an array in place and returns the sorted array. By default, it sorts the elements as strings in ascending order. javascript 2. Reverse an Array The reverse() method reverses the order of the elements in an array. javascript ...
MODIFY AND DELETE ARRAY IN JAVASCRIPT
มุมมอง 62 ชั่วโมงที่ผ่านมา
To modify or delete elements in an array, there are a few common methods in JavaScript. Here are some examples: 1. Modifying an Array Updating an Element: You can change a specific element by referencing its index. javascript Copy code let arr = [1, 2, 3, 4]; arr[1] = 10; // Changes the second element to 10 console.log(arr); // Output: [1, 10, 3, 4] Using splice(): This can add or replace eleme...
MULTIDIMENSIONAL ARRAYS IN JAVASCRIPT
มุมมอง 464 ชั่วโมงที่ผ่านมา
In JavaScript, a multidimensional array is essentially an array of arrays. This means each element of the array can be another array, allowing for multiple "dimensions" or levels. Multidimensional arrays are often used to represent data in a matrix format, like a table or grid, where each row can hold multiple columns. Example of a 2D Array A 2D array is the simplest form of a multidimensional ...
ARRAYS IN JAVASCRIPT PART-2
มุมมอง 447 ชั่วโมงที่ผ่านมา
In JavaScript, an array is a data structure that can hold multiple values in a single variable. Arrays are ordered collections of items, where each item can be of any type, including numbers, strings, objects, or even other arrays. JavaScript arrays are dynamic, meaning they can grow or shrink as elements are added or removed. Key Characteristics: Indexed Elements: Each element in an array has ...
ARRAYS IN JAVASCRIPT
มุมมอง 437 ชั่วโมงที่ผ่านมา
In JavaScript, an array is a data structure that can hold multiple values in a single variable. Arrays are ordered collections of items, where each item can be of any type, including numbers, strings, objects, or even other arrays. JavaScript arrays are dynamic, meaning they can grow or shrink as elements are added or removed. Key Characteristics: Indexed Elements: Each element in an array has ...
NESTED LOOPS IN JAVASCRIPT
มุมมอง 319 ชั่วโมงที่ผ่านมา
In JavaScript, nested loops are loops inside other loops. They're commonly used when dealing with multi-dimensional data structures, such as arrays within arrays, or when you need to perform multiple levels of iteration. The outer loop runs first, and for each iteration of the outer loop, the inner loop runs completely.Loops in JavaScript are used to perform repetitive tasks, running a block of...
BREAK AND CONTINUE STATEMENT IN JAVASCRIPT
มุมมอง 2912 ชั่วโมงที่ผ่านมา
In JavaScript, the break and continue statements are used to control the flow of loops (like for, while, and do...while). Here’s how each of them works: 1. break Statement The break statement is used to exit a loop or a switch statement entirely. When JavaScript encounters a break statement, it immediately stops the current loop and proceeds to the code outside of the loop. continue Statement T...
FOR LOOP IN JAVASCRIPT
มุมมอง 5412 ชั่วโมงที่ผ่านมา
Loops in JavaScript are used to perform repetitive tasks, running a block of code multiple times under specific conditions. Here are the primary types of loops in JavaScript: 1. for Loop The for loop is one of the most common loops. It’s useful when you know how many times you want to iterate. let initializes the counter. is the condition that must be true for the loop to continue. increments t...
DO WHILE LOOP IN JAVASCRIPT
มุมมอง 3612 ชั่วโมงที่ผ่านมา
Loops in JavaScript are used to perform repetitive tasks, running a block of code multiple times under specific conditions. Here are the primary types of loops in JavaScript: 1. for Loop The for loop is one of the most common loops. It’s useful when you know how many times you want to iterate. let initializes the counter. is the condition that must be true for the loop to continue. increments t...
WHILE LOOP IN JAVASCRIPT
มุมมอง 2814 ชั่วโมงที่ผ่านมา
Loops in JavaScript are used to perform repetitive tasks, running a block of code multiple times under specific conditions. Here are the primary types of loops in JavaScript: 1. for Loop The for loop is one of the most common loops. It’s useful when you know how many times you want to iterate. let initializes the counter. is the condition that must be true for the loop to continue. increments t...
JAVASCRIPT KEYBOARD EVENTS
มุมมอง 1114 ชั่วโมงที่ผ่านมา
A keyboard event in web development is triggered when a user interacts with their keyboard on a webpage. It’s part of the DOM (Document Object Model) event system and includes three main types of events: keydown: Fired when a key is initially pressed down. This is often used to detect the start of a key press. keypress: Fired while the key is held down. It’s deprecated in most modern browsers i...
MOUSE EVENTS IN JAVASCRIPT
มุมมอง 4619 ชั่วโมงที่ผ่านมา
mousedown: Triggered as soon as the mouse button is pressed down over an element. Useful for actions that start with a press-and-hold interaction, like dragging or drawing. mouseup: Triggered when the mouse button is released after a click. Commonly used with mousedown for complete click handling or initiating actions that should happen after a click is released. mousemove: Fires whenever the m...
JAVASCRIPT EVENTS CLICK, DOUBLE CLICK, RIGHT CLICK.
มุมมอง 2419 ชั่วโมงที่ผ่านมา
JAVASCRIPT EVENTS CLICK, DOUBLE CLICK, RIGHT CLICK.
GLOBAL/LOCAL VARIABLES IN JAVASCRIPT
มุมมอง 1221 ชั่วโมงที่ผ่านมา
GLOBAL/LOCAL VARIABLES IN JAVASCRIPT
FUNCTION USING PARAMETERS IN JAVASCRIPT
มุมมอง 34วันที่ผ่านมา
FUNCTION USING PARAMETERS IN JAVASCRIPT
Chalo sab batao kaha se watch kar rahe ho😊
how i contact you
@@Sumit-r1g7h why?
@@smitusurendravernekar885 apki help krni h na
hye dear can h help u
@@Sumit-r1g7h yes please
@@smitusurendravernekar885 ok ypu want increas ur followers
@smitusurendravernekar885 How can i contact you
Easyily understood thankyou sister
Thanks please make video on tailwind css
Can u create vedio on react
@@sujindran89 yes soon after we complete javascript
Thank you for the content Sister..it's helpful keep going
@@akhilsugaraju3905 subscribe Karo🙏
<Hello/> hey listen
@@aryanmauryamr.perfect1426 subscribe my channel
Great work ... Never give up
Thankyou subscribe😊
Do subscribe guys 😊
Do subscribe guys😊
Thankyou easily understood
Nice explanation
Useful video