<commit_before>//
// Titles in the Decks
//
// Javascript: Core Concepts
// Javascript: Functions
// Javascript: Common built-in methods
// Javascript: Common event handlers
// Javascript: Design patterns
// CSS
// CSS: Pseudo-classes
// CSS: Animations
// CSS3 - Flexbox
// HTML
// React
// Angular
// Javascript: 3
// Vue
// DOM Fundamentals
// ES6
// JavaScript: Intermediate
// SASS: Basics
// Webpack Basic Concepts
// jQuery: Basics
// General Front End Questions
// Git
//

export function deckData() {
  return [
    {
      title: "Javascript: Core Concepts",
      image: "../style/images/js.png",

      cards: [
        {
          q: "What is event bubbling?",
          a:
            'An event received by an element doesn\'t stop with that one element. That event moves to other elements like the parent, and other ancestors of the element. This is called "event bubbling".'
        },
        {
          q: "What is event delegation?",
          a:
            "Event delegation allows you to avoid adding event listeners to specific nodes;  instead, the event listener is added to one parent.  That event listener analyzes bubbled events to find a match on child elements."
        },
        {
          q: "What is the difference between using == and === ?",
          a:
            "Triple equals uses type coercion and compares both value and type.  It prevents unintentional truthy cases like false == 0."
        },
        {
          q: "What do we call data types copied by VALUE?",
          a: "Primitives"
        },
        {
          q: "What do we call data types copied by REFERENCE?",
          a: "Objects"
        },
        {
          q: "What are the six primitives?",
          a: "Boolean, null, undefined, string, number and symbol"
        },
        {
          q: "What are the three object data types?",
          a: "Array, Function, and Object"
        },
        {
          q: "How can you access properties of an Object in JavaScript?",
          a: 'x.name or x["name"]'
        },
        {
          q: "Difference between call() and apply()?",
          a:
            "CALL() takes a regular listing of parameters and APPLY() requires the parameters to be in an array."
        },
        {
          q: "What is the purpose of -this- operator in JavaScript?",
          a:
            "This, always refers to properties or methods accessible to a developer on an object."
        },
        {
          q: "What are the valid scopes of a variable in JavaScript?",
          a:
            "The region of your program in which it is defined. There are three: \n -Global Variables − A global variable has global scope which means it is visible everywhere in your JavaScript code.\n-Local Variables − A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.\nBlock Scoped variables- variables defined using const/let keywords are scoped to the block in which they are defined."
        },
        {
          q:
            "Which type of variable among global and local, takes precedence over other if names are same?",
          a:
            "A local variable takes precedence over a global variable with the same name."
        },
        {
          q: "What is callback?",
          a:
            "A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered."
        },
        {
          q: "Explain Lexical Scoping",
          a:
            'Lexical Scoping describes how a parser resolves variable names when functions are nested. \nThe word "lexical" refers to the fact that lexical scoping uses the location where a variable is declared within the source code to determine where that variable is available. \nE.G. Nested functions have access to variables declared in their outer scope.'
        },
        {
          q: "What is closure?",
          a:
            "Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope."
        },
        {
          q: "Give an example of closure?",
          a:
            "Following example shows how the variable counter is visible within the create, increment, and print functions, but not outside of them −\nfunction create() {\nvar counter = 0;\nreturn {\nincrement: function() {\ncounter++;\n},\n\nprint: function() {\nconsole.log(counter);\n}\n}\n}\nvar c = create();\nc.increment();\nc.print();     // ==> 1\n"
        },
        {
          q: "Adding a number and a string results in?",
          a:
            "Coercion: converting a value from one type to another. This happens because JS is dynamically typed."
        },
        {
          q:
            'What is the difference between "undefined" and "null" in JavaScript?',
          a:
            '"undefined" means variable is declared but not yet assigned a value and null is a value that can be assigned of type "object".'
        },
        {
          q: "What boolean operators does JavaScript support?",
          a: "&&, || and !"
        },
        {
          q: "What does isNaN function do?",
          a: "Return true if the argument is not a number."
        },
        {
          q:
            'What is the difference between "undefined" and "not defined" in a JavaScript error?',
          a:
            '"Undefined" means a variable is declared but not assingned any values but "Not defined" means the variable is not declared yet.'
        },
        {
          q: "What is the difference between == and === in JavaScript?",
          a:
            "The == operator checks only equality of the values while === checks equality of values with its datatype i.e. values should be of same type."
        },
        {
          q:
            "What are different programming paradigm important for JavaScript developers?",
          a:
            "Procedural Programming with Object Oriented Programming and Fuctional Programming."
        },
        {
          q: "How can you get type of arguments passed to a function?",
          a:
            'Using "typeof" operator. Ex- function abc(x){console.log(typeof x, arguments.length);}//Here when function "abc" is called it returns the type and length of passed value.'
        },
        {
          q:
            "What is the disadvantage of creating true private methods in JavaScript?",
          a:
            "They are very memory inefficient as a new copy of method is created every instance."
        },

        {
          q: "How to use external JavaScript file?",
          a:
            '<script type="text/javascript" src="myfile.js"></script>  "Here It is assumed that myfile.js is the external js file". '
        },
        {
          q:
            'What is the difference between "undefined" and "null" in JavaScript?',
          a:
            '"undefined" means variable is declared but not yet assigned a value and null is a value that can be assigned of type "object".'
        },
        {
          q: "Explain HOISTING",
          a:
            "Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution."
        },
        {
          q: "What's the difference between .call and .apply?",
          a:
            "The difference is that apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly"
        },
        {
          q: "What is function composition?",
          a:
            "Function composition is the process of combining two or more functions to produce a new function. Composing functions together is like snapping together a series of pipes for our data to flow through."
        }
      ]
    },

    // JavaScript: Functions

    {
      title: "JavaScript: Functions",
      image: "../style/images/js.png",
      cards: [
        {
          q:
            "Major difference between function expression vs function declaration?",
          a:
            "Function expression:\n- named or unnamed ex. var myFunc = function( ) { }\n Function declaration: \n- named ex. function myFunc( ) { } "
        },
        {
          q: "Functions are treated as what type in JavaScript?",
          a: "Object"
        },
        {
          q:<commit_msg>adds two questions to core javascript concepts<commit_after>//
// Titles in the Decks
//
// Javascript: Core Concepts
// Javascript: Functions
// Javascript: Common built-in methods
// Javascript: Common event handlers
// Javascript: Design patterns
// CSS
// CSS: Pseudo-classes
// CSS: Animations
// CSS3 - Flexbox
// HTML
// React
// Angular
// Javascript: 3
// Vue
// DOM Fundamentals
// ES6
// JavaScript: Intermediate
// SASS: Basics
// Webpack Basic Concepts
// jQuery: Basics
// General Front End Questions
// Git
//

export function deckData() {
  return [
    {
      title: "Javascript: Core Concepts",
      image: "../style/images/js.png",

      cards: [
        {
          q: "What is event bubbling?",
          a:
            'An event received by an element doesn\'t stop with that one element. That event moves to other elements like the parent, and other ancestors of the element. This is called "event bubbling".'
        },
        {
          q: "What is event delegation?",
          a:
            "Event delegation allows you to avoid adding event listeners to specific nodes;  instead, the event listener is added to one parent.  That event listener analyzes bubbled events to find a match on child elements."
        },
        {
          q: "What is the difference between using == and === ?",
          a:
            "Triple equals uses type coercion and compares both value and type.  It prevents unintentional truthy cases like false == 0."
        },
        {
          q: "What do we call data types copied by VALUE?",
          a: "Primitives"
        },
        {
          q: "What do we call data types copied by REFERENCE?",
          a: "Objects"
        },
        {
          q: "What are the six primitives?",
          a: "Boolean, null, undefined, string, number and symbol"
        },
        {
          q: "What are the three object data types?",
          a: "Array, Function, and Object"
        },
        {
          q: "How can you access properties of an Object in JavaScript?",
          a: 'x.name or x["name"]'
        },
        {
          q: "Difference between call() and apply()?",
          a:
            "CALL() takes a regular listing of parameters and APPLY() requires the parameters to be in an array."
        },
        {
          q: "What is the purpose of -this- operator in JavaScript?",
          a:
            "This, always refers to properties or methods accessible to a developer on an object."
        },
        {
          q: "What are the valid scopes of a variable in JavaScript?",
          a:
            "The region of your program in which it is defined. There are three: \n -Global Variables − A global variable has global scope which means it is visible everywhere in your JavaScript code.\n-Local Variables − A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.\nBlock Scoped variables- variables defined using const/let keywords are scoped to the block in which they are defined."
        },
        {
          q:
            "Which type of variable among global and local, takes precedence over other if names are same?",
          a:
            "A local variable takes precedence over a global variable with the same name."
        },
        {
          q: "What is callback?",
          a:
            "A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered."
        },
        {
          q: "Explain Lexical Scoping",
          a:
            'Lexical Scoping describes how a parser resolves variable names when functions are nested. \nThe word "lexical" refers to the fact that lexical scoping uses the location where a variable is declared within the source code to determine where that variable is available. \nE.G. Nested functions have access to variables declared in their outer scope.'
        },
        {
          q: "What is closure?",
          a:
            "Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope."
        },
        {
          q: "Give an example of closure?",
          a:
            "Following example shows how the variable counter is visible within the create, increment, and print functions, but not outside of them −\nfunction create() {\nvar counter = 0;\nreturn {\nincrement: function() {\ncounter++;\n},\n\nprint: function() {\nconsole.log(counter);\n}\n}\n}\nvar c = create();\nc.increment();\nc.print();     // ==> 1\n"
        },
        {
          q: "Adding a number and a string results in?",
          a:
            "Coercion: converting a value from one type to another. This happens because JS is dynamically typed."
        },
        {
          q:
            'What is the difference between "undefined" and "null" in JavaScript?',
          a:
            '"undefined" means variable is declared but not yet assigned a value and null is a value that can be assigned of type "object".'
        },
        {
          q: "What boolean operators does JavaScript support?",
          a: "&&, || and !"
        },
        {
          q: "What does isNaN function do?",
          a: "Return true if the argument is not a number."
        },
        {
          q:
            'What is the difference between "undefined" and "not defined" in a JavaScript error?',
          a:
            '"Undefined" means a variable is declared but not assingned any values but "Not defined" means the variable is not declared yet.'
        },
        {
          q: "What is the difference between == and === in JavaScript?",
          a:
            "The == operator checks only equality of the values while === checks equality of values with its datatype i.e. values should be of same type."
        },
        {
          q:
            "What are different programming paradigm important for JavaScript developers?",
          a:
            "Procedural Programming with Object Oriented Programming and Fuctional Programming."
        },
        {
          q: "How can you get type of arguments passed to a function?",
          a:
            'Using "typeof" operator. Ex- function abc(x){console.log(typeof x, arguments.length);}//Here when function "abc" is called it returns the type and length of passed value.'
        },
        {
          q:
            "What is the disadvantage of creating true private methods in JavaScript?",
          a:
            "They are very memory inefficient as a new copy of method is created every instance."
        },

        {
          q: "How to use external JavaScript file?",
          a:
            '<script type="text/javascript" src="myfile.js"></script>  "Here It is assumed that myfile.js is the external js file". '
        },
        {
          q:
            'What is the difference between "undefined" and "null" in JavaScript?',
          a:
            '"undefined" means variable is declared but not yet assigned a value and null is a value that can be assigned of type "object".'
        },
        {
          q: "Explain HOISTING",
          a:
            "Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution."
        },
        {
          q: "What's the difference between .call and .apply?",
          a:
            "The difference is that apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly"
        },
        {
          q: "What is function composition?",
          a:
            "Function composition is the process of combining two or more functions to produce a new function. Composing functions together is like snapping together a series of pipes for our data to flow through."
        },
		{
		  q: "What is DOM in javascript?",
		  a:
			"A hierarchial structure to access or modify a web page is called Document Object Model or DOM."
		},
		{
		  q: "How do you reference a form field in javascript?",
		  a:
		    'To refer a form field from javascript, you can use : document.getElementById("myform").txtName or document.getElementById("myform") methods'
		}	
      ]
    },

    // JavaScript: Functions

    {
      title: "JavaScript: Functions",
      image: "../style/images/js.png",
      cards: [
        {
          q:
            "Major difference between function expression vs function declaration?",
          a:
            "Function expression:\n- named or unnamed ex. var myFunc = function( ) { }\n Function declaration: \n- named ex. function myFunc( ) { } "
        },
        {
          q: "Functions are treated as what type in JavaScript?",
          a: "Object"
        },
        {
          q:
{'fraction_non_alphanumeric': 0.08465791292328956, 'fraction_numerical': 0.000691085003455425, 'mean_word_length': 1.942721572614811, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3575862', 'n_tokens_mistral': 4364, 'n_tokens_neox': 4162, 'n_words': 2060}