var people = 1526006;Integers
var land = 135.1;Float
var nickname = 'Philly';String
var division= function(a,b){return a / b; };Functionsvar teams = ['Eagles', '76ers', 'Phillies', 'Flyers'];Arrays
var philidelphia ={
'population' : people,
'squareMilesLand': Land,
'nickname': nickname,
'teams': teams};Objectsvar density = division( philidelphia.population, philidelphia.squareMilesLand);
density === 11295.38119911177 // true
nickname.slice(2,6);illy
density.toFixed(2);11295.38
var dogfighting = 'bad';
function vick(){
alert(dogfighting); // bad
}
var passing = 'decent';
function vick(){
passing = 'good';
}
vick(); // passing now is good
function vick(){
var passing = 'good';
}
alert(passing); // Passing isn't defined
(function($){
// Fun Stuff Goes Here
})(jQuery);
class Jorbin_DFV{
function __construct(){
add_action( 'admin_enqueue_scripts', array( $this , 'add_script' ) );
}
function add_script($hook){
if ('post.php' !== $hook && 'post-new.php' !== $hook)
return;
wp_enqueue_script( 'distractionFreeVim', plugins_url('dfv.js', __FILE__), array( 'wp-fullscreen' , ));
}
}
new Jorbin_DFV();
(function($){
// Fun Stuff Goes Here
})(jQuery);$(document).bind( 'wp_CloseOnEscape', function(e, data){
data.cb = function(e) {
fullscreen.bounder( 'showToolbar', 'hideToolbar', 10000, e );
fullscreen.save();
};
});