Ayyan has Published 50 Articles

What are async generator methods in JavaScript?

Ayyan

Ayyan

Updated on 12-Jun-2020 08:08:22

200 Views

Async generator functions are the same like generator function. The async generator functions will return an object, whereas an async generator whose methods such as next, throw and return promises for { value, done }, instead returning directly.ExampleHere’s an example from GitHub showing function returning async generator object −async function* ... Read More

Which event occurs in JavaScript when an element is dragged completely?

Ayyan

Ayyan

Updated on 22-May-2020 11:30:29

98 Views

The ondragend event triggers when an element is dragged completely.ExampleYou can try to run the following code to learn how to implement ondragend event in JavaScript.                    .drag {             float: left;           ... Read More

What is the role of scrollY property in JavaScript?

Ayyan

Ayyan

Updated on 20-May-2020 11:02:34

371 Views

The scrollY property in JavaScript works the same as pageYoffset property. If you want to get the pixels the document scrolled to from the upper left corner of the window, then use the scrollY property for vertical pixels.ExampleYou can try to run the following code to learn how to work ... Read More

Is it a good practice to place all declarations at the top in JavaScript?

Ayyan

Ayyan

Updated on 20-May-2020 09:07:11

120 Views

Yes, it is a good practice to place all the JavaScript declarations at the top. Let’s see an example −Example           JavaScript String match() Method                        // all the variables declared at top   ... Read More

How to write "Hello World" Program in C++?

Ayyan

Ayyan

Updated on 26-Feb-2020 10:50:53

1K+ Views

To run the hello world program, you'll have to follow the following steps −Write a C++ programNow that you have a compiler installed, its time to write a C++ program. Let's start with the epitome of programming example's, it, the Hello world program. We'll print hello world to the screen ... Read More

How to compare String equality in Java?

Ayyan

Ayyan

Updated on 26-Feb-2020 06:30:47

341 Views

You can check the equality of two Strings in Java using the equals() method. This method compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this ... Read More

String Concatenation by + (string concatenation) operator.

Ayyan

Ayyan

Updated on 26-Feb-2020 05:57:58

403 Views

You can concatenate strings using the ‘+’ operator of Java.ExampleLive Demopublic class Test {    public static void main(String args[]){       String st1 = "Hello";       String st2 = "How";       String st3 = "You";       String res = st1+st2+st3;       System.out.println(res);    } }OutputHelloHowYou

String Concatenation in Java

Ayyan

Ayyan

Updated on 26-Feb-2020 05:16:46

653 Views

You can concatenate two strings in Java either by using the concat() method or by using the ‘+’ , the “concatenation” operator.The concat() methodThe concat() method appends one String to the end of another. This method returns a String with the value of the String passed into the method, appended ... Read More

Are there any ways to Manipulate Strings in Java.

Ayyan

Ayyan

Updated on 26-Feb-2020 05:11:31

164 Views

Since String class is immutable once created we cannot modify the data of the string. But still, if you want to manipulate string data you can rely on StringBuffer or StringBuilder classes.Examplepublic class Test {    public static void main(String args[]) {       String str = "Hi welcome ... Read More

What is the Java Runtime Environment (JRE)?

Ayyan

Ayyan

Updated on 25-Feb-2020 08:19:34

503 Views

JRE is Java Runtime Environment and is the machine-specific implementation of JVM. It contains libraries like rt.jar, class loaders etc which are used by JVM.

Advertisements