Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [1,2,3,4,5].each do |e| #do starts the block
- puts e
- end #end ends it
- $.each([1,2,3,4,5], function(e) { //Anonymous *function* starts here
- console.log(e);
- }); //Ends here
- class Array
- def my_each
- i = 0
- while(i<self.length)
- yield self[i]
- i+=1
- end
- end
- end
- def foo(&block)
- end
- def Proc.new(&block)
- block
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement