Monday, 6 April 2020

Javascript Concepts Functions Related

  • Global Scope
  • Local Scope
var greeting='Welcome to blog';
(function(){
  console.log(greeting); //Output: Welcome to blog
})();
consider above code greeting variable should be global scope, it can access inside the function,
(function(){var greeting = 'Welcome to blog';
  console.log(greeting); //Output: Welcome to blog
})();console.log(greeting); //Output:Reference-Error greeting not defined

Translate manually Wordpress

 add_filter( 'gettext', function( $translated, $original, $domain ) {     // Senarai penggantian (case-insensitive)     $map = array...