Test JS script file

Selected file: 01fun_definition.js
Compare console.log() outputs in browser and NodeJS.
Notice: Open browser's console in FireBUG!

  1. 01fun_definition.js
  2. 02fun_parameter_var.js
  3. 03fun_parameter_callback.js
  4. 03fun_parameter_callback2.js
  5. 03fun_parameter_callback3.js
  6. 05fun_var_in_global_scope.js
  7. 06fun_global_var_in_function.js
  8. 07fun_global_var_in_callback.js

..:: Source code - 01fun_definition.js ::..

/**
 * Fnction definitions
 */

//function
function fja1() {}

//function assigned to variable
var fja2 = function() {}


//function assigned to object
var obj = {
	fja3: function() {}
} 


console.log(typeof fja1 +': '+fja1);
console.log(typeof fja2 +': '+fja2);
console.log(typeof obj.fja3 +': '+obj.fja3);


 

..:: NodeJS Console - 01fun_definition.js ::..

$ node 01fun_definition.js
function: function fja1() {}
function: function() {}
function: function() {}
$ps -aux | grep node (list all node processes)
sasa         914  0.4  0.5 1307312 85504 ?       Ssl  Aug04 251:58 node /home/sasa/.pm2/modules/pm2-logrotate/node_modules/pm2-logr
sasa         935  0.7  0.8 11787352 133332 ?     Ssl  Aug04 375:43 node /home/sasa/dex8/dex8-api/starter.js
sasa         938  0.3  0.4 1306332 75240 ?       Ssl  Aug04 208:31 node /home/sasa/regoch/regoch-www/server
sasa         945  0.3  0.4 1303752 71452 ?       Ssl  Aug04 182:28 node /home/sasa/dex8/dex8-panel/server/index.js
sasa         947  0.7  0.6 11828756 108928 ?     Ssl  Aug04 375:22 node /home/sasa/dex8/dex8-www/server/index.js
sasa         966  0.5  0.6 11809488 99196 ?      Ssl  Aug04 278:57 node /home/sasa/mikosoft_hr/www-mikosoft-hr/server/index.js
sasa         980  0.6  0.5 1330216 83080 ?       Ssl  Aug04 372:48 node /home/sasa/mikosoft-info/api-mikosoft-info/starter.js
sasa         997  0.3  0.4 1306204 71256 ?       Ssl  Aug04 184:11 node /home/sasa/mikosoft-info/www-mikosoft-info/server/index.js
sasa        1021  0.3  0.3 1297832 64672 ?       Ssl  Aug04 181:35 node /home/sasa/dex8/dex8-kiosk/server/index.js
sasa        1065  0.5  0.5 11840632 95388 ?      Ssl  Aug04 309:37 node /home/sasa/mikosoft-info/dodo-mikosoft-info/server/index.js
sasa        1074  0.5  0.6 1148672 104612 ?      Ssl  Aug04 300:16 node /home/sasa/voovuu/voovuu-api/starter.js
sasa        1136  0.6  0.9 11862132 157812 ?     Ssl  Aug04 349:18 node /home/sasa/voovuu/voovuu-pub/server/index.js
sasa        1148  0.3  0.4 11794644 77976 ?      Ssl  Aug04 200:36 node /home/sasa/@mikosoft/dodo-examples/server/index.js
sasa        1197  0.3  0.3 1099884 62948 ?       Ssl  Aug04 188:00 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1199  0.3  0.4 22278524 77828 ?      Rsl  Aug04 189:55 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1308  0.3  0.3 1099872 63452 ?       Ssl  Aug04 187:23 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1325  0.3  0.3 1099360 63508 ?       Ssl  Aug04 187:20 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1393  0.7  0.8 22323968 143612 ?     Ssl  Aug04 393:59 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1395  0.3  0.3 1099884 63048 ?       Ssl  Aug04 188:02 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1489  0.3  0.3 1099872 63336 ?       Ssl  Aug04 187:55 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1496  0.3  0.3 1100384 65208 ?       Ssl  Aug04 187:02 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1607  0.3  0.3 1099872 63680 ?       Ssl  Aug04 187:26 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1608  0.3  0.3 1099872 62980 ?       Rsl  Aug04 186:22 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1686  0.8  0.8 11841764 144152 ?     Ssl  Aug04 470:10 node /home/sasa/mikosoft-info/crypto-mikosoft-info/server/index.
www-data   12001  0.0  0.0   2608   596 ?        S    15:41   0:00 sh -c ps -aux | grep node
www-data   12003  0.0  0.0   3304   660 ?        S    15:41   0:00 grep node
sasa     1371685  0.3  0.5 11800380 87376 ?      Rsl  Aug16 138:35 node /home/sasa/mikosoft-info/solar-wind-energy/server/index.js
sasa     1460918  0.3  0.4 1299880 65892 ?       Ssl  Aug17 135:29 node /home/sasa/sites-nodejs/oxygen-free-copper/server.js