How to check jQuery version?

Sometimes you need to know what is the jQuery version that your script is working with. This maybe useful in you jQuery plugins, so your code can utilize the jQuery version specific code or maybe your code is running in some environment that already has jQuery embedded in, for example Drupal CMS.

Anyway, here are two ways you can check the current jQuery version.

// Returns string Ex: "1.3.1"
$().jquery;

// Also returns string Ex: "1.3.1"
jQuery.fn.jquery;