Showing posts with label method. Show all posts
Showing posts with label method. Show all posts

How to check docstring or method details of a method in Jupyter notebook?

When using a method in Jupyter notebook, it always comes convinient by checking docstring or method details of a method, e.g., what parameters the method have. Here we have two options to check those.

The first option is add "?" at the end of the method you would like to check and run the cell, which will give you the method details in a printed format.




The second option is using the combination of "shift+tab" keys with the mouse cursor inside the method bracket, which will show you method details in a format below.



jQuery - on() method

.on() method can be though of .on() as a general handler that takes the event, its selector, and an action as inputs.

 $(document).ready(function(){  
   $('#button').click(function(){  
     var toAdd = $('input[name=checkListItem]').val();   
     $('.list').append("<div class='item'>"+toAdd+"</div>");  
   });   
   $(document).on('click','.item',function(){  
     $(this).remove();    
   });  
 });  

JavaScript - literal notation for adding methods in Object

1:  var james = {  
2:    job: "programmer",  
3:    married: false,  
4:    speak: function( msg ) {  
5:      console.log("Hello, I am feeling "+msg);  
6:    }  
7:  };  
8:  james.speak("great");  
9:  james.speak("just okay");