التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف JAVASCRIPT

FAANG Company Interview Question | Most Important MNC Interview Question

 Practice Questions Find all triplets with zero sum Generate all binary strings from given pattern Count of strings that can be formed using a, b and c under given constraints Find largest word in dictionary by deleting some characters of given string Find subarray with given sum | Set 1 (Nonnegative Numbers) Find the longest substring with k unique characters in a given string Find the two non-repeating elements in an array of repeating elements Flood fill Algorithm – how to implement fill() in paint? Meta Strings (Check if two strings can become same after a swap in one string) Print all Jumping Numbers smaller than or equal to a given value Sum of all the numbers that are formed from root to leaf paths The Celebrity Problem Unbounded Knapsack (Repetition of items allowed) Medium Level Backtracking | Set 7 (Sudoku) Boggle | Set 2 (Using Trie) Check if a Binary Tree contains duplicate subtrees of size 2 or more Dynamic Programming | Set 33 (Find if a string is interleaved of two o...

JavaScript Predefine Function for Array and String | Predefine Javascript function list

 JavaScript Predefine Function for Array and String: JavaScript has several predefined functions for arrays that can be quite handy. Here are a few of them: 1. `push()`: Adds one or more elements to the end of an array.    let fruits = ['apple', 'banana'];    fruits.push('orange');    // ['apple', 'banana', 'orange']    2. `pop()`: Removes the last element from an array.      let fruits = ['apple', 'banana', 'orange'];    fruits.pop();    // ['apple', 'banana']   3. `shift()`: Removes the first element from an array.      let fruits = ['apple', 'banana', 'orange'];    fruits.shift();    // ['banana', 'orange']    4. `unshift()`: Adds one or more elements to the beginning of an array.    `    let fruits = ['banana', 'orange'];    fruits.unshift('apple');    // ['apple', 'banana', 'orange'] 5. `splice()`: Adds or r...

Data type concept in Javascript | Javascript Datatype in simple way

 Data type in JavaScript: JavaScript is a versatile and powerful programming language widely used for web development. One of its key features is its flexibility in handling data types. JavaScript is a loosely coupled language, which means it determines the data type of a variable at runtime. This provides flexibility, allowing variables to store any type of data. Let's dive into the different data types in JavaScript and understand their significance. Why Data Types Matter Data types help in determining the size of data in memory and dictate what kind of operations can be performed on the data. In JavaScript, the data type of a variable can change during the execution of a program, allowing for dynamic and flexible programming. Scalability of JavaScript Variables In JavaScript, a variable's memory can scale up and scale down based on the data assigned to it. This dynamic allocation and reallocation of memory make JavaScript efficient in handling varying data sizes. Types of Da...

What is Javascript?

Javascript:-  It is the client-side (browser side) s cript-based language that is used to implement business logic, validation, animation, and dynamic design view in web applications. Javascript has been modified and implemented using a different library. 1 Jquery 2 Angular 3 Angular Js 4 Node JS 5 React 6 React native 7 Knockout 8 Particle 9 Express Javascript Architecture:- DOM (Document Object Model):- Javascript provides a separate window with a document to contain and access all Html elements. Javascript can provide accessibility to all HTML elements. If we want to access an HTML element using javascript then we can use two different syntax 1) document.getElementById("idname").attribute 2) document.getElementsByName("elementname").attribute <input type="text" id="txt"  /> a=document.getElementById("txt").value; We can write Javascript under HTML documents because without an HTML document JS has no role.      < script> ...

Javascript Detailed Description

It is a client-side script that is used to perform the dynamic operation under an HTML Web page. HTML only provides a set of elements and attributes, CSS provides a set of properties and Javascript provides dynamic code, client-side logic development, validation and animation in the HTML web page. Javascript can be executed in any Web Browser as compare to other scripts. Syntax of JavaScript:- We can write JS Code into two different ways:- 1)  Under HTML Web page in <head></head> using <script>  </script> tag    example of internal JS:-    <!DOCTYPE html> <html> <head>     <title></title>     <script type="text/javascript">                 alert("welcome in JS");     </script> </head> <body>    <h1>Welcome in HTML</h1> </body> </html...

Event in JavaScript

It is used to perform an action in HTML elements, event will be defined as a method and call under HTML elements using event action. for example, onclick is the event that will be called when we click on the button. Javascript is called an event-driven based language. Javascript has multiple event methods 1) onkeypress  --->  when we press keyboard any button then it will be called 2) onkeyup  ------> when we press any key then the first onkeyup event will be called 3) onmouseover --->  when we over the mouse under the HTML element then this event will be called 4) onmouseout --->   when we remove mouse control from the HTML element then this event will be 5) onfocus ------>     When cursor will be assigned into a particular HTML element then this event will be called 6) onblur  ---->       When we remove the cursor from the HTML element then this event will be raised 7) onclick  ----->    ...