GithubHelp home page GithubHelp logo

carma-test's Introduction

Node Version

v16.14.2

Setup project

npm install

Encryption

For encryption I have use cipher of Node js crypto with ""aes-256-cbc"" Algorithan which widely used for encryption and consider as more safe and easy to handle.

Luhn algorithm

I use https://www.npmjs.com/package/luhn-js for validating the card number it is easy to use and give you different methods

Question# 01
for (var i = 0; i < 100; i++) {
setTimeout(function() {
console.log(i);
}, 200);

}

OUTPUT:
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100

Reason:
the calls to setTimeout() โ€” take almost no time at all. which is telling the system,  call this function after 200 milliseconds" 
will return almost immediately, as the process of installing the timeout request in the timer queue is very fast.

Question# 02
(async function() {
function waitForMe() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve("hello");
}, 200);
});
}
const result = await waitForMe();
console.log(result);
})();

// it is an IIFE.
OUTPUT:
hello
Question# 03
to entire function.
let b;// it is a use to declare block scope variable it doesnt declare globally in other words it is use to declare variable to an expression or block.
const c; // it is use to declare a variable to define a variable which value do not change over the program 
Question# 03
var arr = [];
module.exports = arr;

We got a module using it: // module 01
var test = require("./test");
test.push("hello");
console.log(JSON.stringify(test));

We got another module using it later:// moduule 02
var test = require("./test");
test.push("another");
console.log(JSON.stringify(test));

OUTPUT:

 in module 2 we get ["another"] because each module use it own instance for a test.js modeule ```

carma-test's People

Contributors

osamaimran25 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.