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.5  0.5 1306896 83832 ?       Ssl  Aug04 313:06 node /home/sasa/.pm2/modules/pm2-logrotate/node_modules/pm2-logr
sasa         935  0.7  0.8 11786840 132488 ?     Ssl  Aug04 463:41 node /home/sasa/dex8/dex8-api/starter.js
sasa         938  0.4  0.4 1307036 75952 ?       Ssl  Aug04 263:51 node /home/sasa/regoch/regoch-www/server
sasa         945  0.3  0.4 1303752 71292 ?       Ssl  Aug04 226:32 node /home/sasa/dex8/dex8-panel/server/index.js
sasa         947  0.7  0.6 11850604 111056 ?     Ssl  Aug04 463:19 node /home/sasa/dex8/dex8-www/server/index.js
sasa         966  0.5  0.5 11808976 97496 ?      Ssl  Aug04 348:29 node /home/sasa/mikosoft_hr/www-mikosoft-hr/server/index.js
sasa         980  0.7  0.5 1330216 83084 ?       Ssl  Aug04 475:08 node /home/sasa/mikosoft-info/api-mikosoft-info/starter.js
sasa         997  0.3  0.4 1303104 72564 ?       Ssl  Aug04 228:49 node /home/sasa/mikosoft-info/www-mikosoft-info/server/index.js
sasa        1021  0.3  0.3 1297920 65480 ?       Ssl  Aug04 225:37 node /home/sasa/dex8/dex8-kiosk/server/index.js
sasa        1065  0.6  0.5 11822688 97476 ?      Ssl  Aug04 383:20 node /home/sasa/mikosoft-info/dodo-mikosoft-info/server/index.js
sasa        1074  0.6  0.6 1149316 104040 ?      Ssl  Aug04 374:47 node /home/sasa/voovuu/voovuu-api/starter.js
sasa        1136  0.7  0.9 11865716 161404 ?     Ssl  Aug04 436:23 node /home/sasa/voovuu/voovuu-pub/server/index.js
sasa        1148  0.4  0.4 11794644 78224 ?      Ssl  Aug04 249:38 node /home/sasa/@mikosoft/dodo-examples/server/index.js
sasa        1197  0.3  0.3 1099884 63156 ?       Ssl  Aug04 233:13 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1199  0.3  0.4 22278780 78904 ?      Ssl  Aug04 236:32 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1308  0.3  0.3 1099616 63648 ?       Ssl  Aug04 232:30 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1325  0.3  0.3 1099360 63276 ?       Ssl  Aug04 232:24 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1393  0.7  0.8 22320612 140792 ?     Ssl  Aug04 479:03 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1395  0.3  0.3 1099884 62856 ?       Ssl  Aug04 233:29 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1489  0.3  0.3 1100128 63036 ?       Ssl  Aug04 233:25 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1496  0.3  0.3 1100384 64920 ?       Ssl  Aug04 232:11 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1607  0.3  0.3 1099872 63712 ?       Ssl  Aug04 232:45 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1608  0.3  0.3 1099872 63756 ?       Ssl  Aug04 231:38 node /home/sasa/dex8/dex8-worker/starter.js
sasa        1686  1.1  0.9 11846976 148052 ?     Ssl  Aug04 687:45 node /home/sasa/mikosoft-info/crypto-mikosoft-info/server/index.
www-data  622144  0.0  0.0   2608   596 ?        S    18:35   0:00 sh -c ps -aux | grep node
www-data  622146  0.0  0.0   3304   648 ?        R    18:35   0:00 grep node
sasa     1371685  0.4  0.5 11803816 90328 ?      Ssl  Aug16 186:43 node /home/sasa/mikosoft-info/solar-wind-energy/server/index.js
sasa     1460918  0.4  0.3 1300136 65152 ?       Ssl  Aug17 184:22 node /home/sasa/sites-nodejs/oxygen-free-copper/server.js