Ayyan has Published 52 Articles

What are async generator methods in JavaScript?

Ayyan

Ayyan

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

145 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

52 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

291 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

72 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

811 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 check Palindrome String in java?

Ayyan

Ayyan

Updated on 26-Feb-2020 06:44:39

16K+ Views

StringBuffer provides a method with name reverse() one way to check for a palindrome isCreate a StringBuffer object by passing the required string as a parameter to the constructor.Reverse the contents of the object using the reverse() method.Convert the StringBuffer object to Sting using the toString() method.Now, compare the String and the ... Read More

How to compare String equality in Java?

Ayyan

Ayyan

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

234 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

316 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

Java String Concatenation with Other Data Types.

Ayyan

Ayyan

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

937 Views

If you try to concatenate strings using concat() method, you can concat variables of string data type only.To concatenate strings with other data type you need to use the ‘+’ operator.Examplepublic class Test {    public static void main(String args[]){       String st1 = "Hello";       ... Read More

String Concatenation in Java

Ayyan

Ayyan

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

527 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

Advertisements