Skip to main content

Posts

Showing posts from August 16, 2021

C# Shortcuts for quick programming

C# Shortcuts for quick programming   C# comes with full of surprises when you are doing the coding, here is the short list of commands that you can use it to generate the C# code automatically and quickly Enter prop and press tab 2 times (prop tab tab) Generate a property public int MyProperty { get ; set ; } class tab tab Generates a empty class         class MyClass         {                     } Ctor tab tab (inside the class) Generates a parameter less constructor             public MyClass()             {               } For tab tab Generates an empty for loop             for ( int i = 0; i < length; i++)             {                             } Foreach tab tab Generates an empty foreach loop               foreach ( var item in collection)             {                             } Do tab tab   Generates an empty do while loop               do              {                             } while

NodeJS Interview Questions

NodeJS Interview Questions 1) How to access the Windows Environment Variables programmatically via NodeJS? The process.env will provide the required functionality.    process . env . HOME    process . env . HOMEPATH   In order to have this dynamically we can have      var    nodePath  =  'NODE_PATH' ;    process . env [ nodePath ];   2) What is async and await in NodeJS? async à in simple terms marks the function to run asynchronously await à Marks the caller to wait until the function executes. 3) How to create a directory in NodeJS?      var   fileSystem  =  require ( 'fs' );     var   DIR_NAME  =  'test' ;      if (! fileSystem . exists ( DIR_NAME )){      fileSystem . mkdir ( DIR_NAME );   }   4) How to use jQuery in NodeJS? We need to install jQuery via npm then use it as follows npm   install   jquery Usually point it to $ by var   $  =  require ( 'jquery' );  Sometimes we need to install the