Genre not found
Artist not found
Album not found
Song not found

javascript void;
Madney Bundish Lyrics


No lyrics text found for this track.

The lyrics can frequently be found in the comments below, by filtering for lyric videos or browsing the comments in the different videos below.
Most interesting comment from YouTube:

Steve Griffith

void is used to have functions treated like expressions. That means that they won't return a value. Sometimes you have a function that you don't need anything to be returned from. In cases like this, you can put void in front of the call to explicitly say that you don't need anything back.
The most common use case was to put "void" in front of other code that you are running from inside an HTML anchor tag. <a href="javascript: void myFunc( )">
javascript: is the protocol.
myFunc( ) is the code that I want to run.
void tells the browser to treat the function like an expression. Nothing(undefined) gets returned and the link doesn't go anywhere.
If you are going to be altering styles with JavaScript you can do that in any function. You don't need to use void. A best practice would be to group all your style or DOM manipulations into functions on their own. Then you could call the functions with void in front of the call to explicitly say that nothing is expected back from the function. The return value will be undefined. Eg:
function one( ){
//do somethings
//do more things
void myFunctionToChangeStyles( );
}
Here I am calling my function and saying that I don't care about the result. Just pretend that it is an expression that has no return value.
You can also put them in front of IIFEs (I have a video on these too) if the function is not returning anything.
void function( ){
//do something
}( );
This example is the same as:
(function( ){
//do something
})( );



All comments from YouTube:

rot rose

Thank you very much for the explanation of this abstract subject, it may take some time for me to really understand it, but I will continue.

Yarik83Men

+++

Ahsath

Hi! do you have any videos about get and set?

Ahsath

I already saw thoses <3

Steve Griffith

I have now posted one video about ES6 Object method syntax that includes getters and setters and another video about Object property methods including get and set.

Steve Griffith

I'm currently working on videos for Object.defineProperty, the get and set within that method, as well as the new ES6 way of defining object methods and the get and set that come along with it.

Kuldeep Kr

hi, can you elaborate the use-case of void you were talking about in the last of your video. How to use void operator to style any page without affecting other things.

Rahul Dubey

@Steve Griffith thnx my doubt is clear after reading your reply

Steve Griffith

void is used to have functions treated like expressions. That means that they won't return a value. Sometimes you have a function that you don't need anything to be returned from. In cases like this, you can put void in front of the call to explicitly say that you don't need anything back.
The most common use case was to put "void" in front of other code that you are running from inside an HTML anchor tag. <a href="javascript: void myFunc( )">
javascript: is the protocol.
myFunc( ) is the code that I want to run.
void tells the browser to treat the function like an expression. Nothing(undefined) gets returned and the link doesn't go anywhere.
If you are going to be altering styles with JavaScript you can do that in any function. You don't need to use void. A best practice would be to group all your style or DOM manipulations into functions on their own. Then you could call the functions with void in front of the call to explicitly say that nothing is expected back from the function. The return value will be undefined. Eg:
function one( ){
//do somethings
//do more things
void myFunctionToChangeStyles( );
}
Here I am calling my function and saying that I don't care about the result. Just pretend that it is an expression that has no return value.
You can also put them in front of IIFEs (I have a video on these too) if the function is not returning anything.
void function( ){
//do something
}( );
This example is the same as:
(function( ){
//do something
})( );

Maximilian

Nice microwave sounds ;) Still, very useful video. thanks!

More Comments