Found 8862 Articles for Front End Technology

HTML checked Attribute

Smita Kapse
Updated on 10-Jun-2020 07:15:29

203 Views

The checked attribute of the element specifies that the input type checkbox is checked when the web page loads. You can also use this attribute with input type radio.Following is the syntax −Above, we have set it checked since we wanted the checkbox to be selected when the web page loads.Let us now see an example to implement the checked attribute of the element −Example Live Demo Register Id:  Password:  DOB:  Telephone:  Email:  Newsletter Subscription:  Submit OutputIn the above example, we have a form with a button − Id:  Password:  DOB:  Telephone:  Email:  Newsletter ... Read More

HTML Color Styles

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

254 Views

Colors are very important to give a good look and feel to your website.Hex Code (Hexadecimal colors representation)A hexadecimal is a 6 digit representation of a color. The first two digits (RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).A hexadecimal value can be taken from any graphics software like Adobe Photoshop. Each hexadecimal code will be preceded by a pound or hash sign #. Following is a list of few colors using hexadecimal notation. Following are some examples of hexadecimal colors −Let us see an example to implement the ... Read More

What is Fisher–Yates shuffle in JavaScript?

Nikhilesh Aleti
Updated on 23-Sep-2022 11:00:04

4K+ Views

Given an array, and generate the random permutation of array elements. It is similar like shuffling a deck of cards or randomize an array and every outcome after shuffling of array elements should likely and equally. Input output scenarios Consider an array having some elements present in it and assume we have performed fisher yates shuffle on that array. The output array will be randomly shuffled and shuffles for every time we execute. All the permutations are equally and likely. Input = [2, 4, 6, 8, 10] Output = 4, 10, 6, 2, 8 // first iteration ... Read More

How to implement merge sort in JavaScript?

Nikhilesh Aleti
Updated on 23-Sep-2022 10:53:24

9K+ Views

Merge Sort The Merge Sort algorithm, where we can sort the elements in a particular order. This algorithm is also considered as an example of divide and conquer strategy. In merge sort algorithm, firstly the array will be divided into two parts and combined a particular sorted manner. The array will be divided into half until it cannot be divided. This means that if the array is completely divided and cannot be further divided, the dividing will be stopped. We divide the arrays into halves and implement merge sort on each of the halves. This algorithm is a ... Read More

Write a number array and using for loop add only even numbers in javascript?

Vivek Verma
Updated on 29-Aug-2022 10:01:31

1K+ Views

An array in JavaScript is an datatype which contains similar types of data. A number array is defined as the array object with numbers as its content. These numbers are divided into even and odd types on a basic level of mathematics. In this article, we will look into outputting the even number of any number array. Syntax let arr = [val1, val2, val3, …]; Now, let us consider an array arr with numbered elements and print the content in the 0th index − Example let ... Read More

Write a program to find the index of particular element in an array in javascript?

Vivek Verma
Updated on 29-Aug-2022 08:05:40

898 Views

Array is an object which contains multiple values of the same datatype in a sequential order. In other words, we can say that an array is a special type of object in the JavaScript. SyntaxWe can create an array in two ways in JavaScript. The syntax are given below − var arr = [val1, val2, …]; var arr = new Array(“val1”, “val2”, …) Now let us look at a simple JavaScript program to create an array and print its index values − var arr = [1, 2, 3, 4, 5]; document.write(arr[0]); Here, the program returns the content in ... Read More

What is bootstrap and what is its use as a framework?

Dev Kumar
Updated on 28-Apr-2022 09:25:01

212 Views

There are several uses of Bootstrap as a framework since it offers design templates based on HTML and CSS technology covering the structure of a webpage and its visual and aural layout for various devices. Bootstrap also supports plugins for JavaScript and its design templates include variables like navigation, typography, tables, image carousels, buttons, forms, models and many more.For Creating LayoutsToday, most developers prefer Bootstrap for creating layouts because it has a highly responsive CSS that sets easily across both mobile devices as well as desktop and laptop computers. When it comes to browsers, Bootstrap adjusts seamlessly with most of ... Read More

TypedArray.toString() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:32:31

31 Views

The toString() function of the TypedArray object returns a string representing the contents of the typed array.SyntaxIts Syntax is as followstypedArray.toString();Example Live Demo    JavaScript Example           var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]);       var result = typedArray.toString();       document.write("Contents of the typed array: "+result);     OutputContents of the typed array: 111,56,62,40,75,36,617,2,139,827

TypedArray.subarray() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:32:43

44 Views

The subarray() function of the TypedArray object returns portion of the current array. It accepts two numbers representing the start and end of the sub array.SyntaxIts Syntax is as followstypedArray.subarray(5, 9)Example Live Demo    JavaScript Example           var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]);       var result = typedArray.subarray(3, 7);       document.write("Contents of the typed array: "+result);     OutputContents of the typed array: 40,75,36,617

TypedArray.slice() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:36:07

60 Views

The slice() method of the typed array object returns a portion or, chunk from the array buffer (as a separate object). It accepts two integer arguments representing the start and end of the portion of the array to be returned.SyntaxIts Syntax is as followsarrayBuffer.slice(3, 8)Example Live Demo    JavaScript Array every Method           var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);       document.write("Contents of the typed array: "+typedArray);       document.write("");       var resultantArray = typedArray.slice(2, 7);       document.write("Resultant Array: "+resultantArray);     OutputContents of the typed array: 11,5,13,4,15,3,17,2,19,8 ResultantArray: 13,4,15,3,1

Advertisements