Method Chaining

How to chain functions in JavaScript

How to write chaining fn like $('.red').addClass('blue').removeClass('red')