2023 javascript interview questions

 2023 javascript interview questions मै दोस्तों आपका स्वागत है 

2023 javascript interview questions difference between Java & JavaScript से लेकर javascript का syntax और javascript का छोटे बड़े टॉपिक शामिल होगे 

Q 1.  What is the difference between Java & JavaScript

2023 javascript interview questions

Q 2. javascript advantage


Versatility and Ubiquity:

Easy to Learn

Interactivity and Rich User Interfaces

Asynchronous Programming:

Large and Active Community:

Cross-platform Compatibility:

Open Source and Free:

Real-time Communication:

Functional Programming Support:

Cross-platform Mobile App Development:

Server-side Development: 


Q 3. javascript disadvantage


Browser Compatibility Issues:

Security Concerns

Performance Challenges:

No Multithreading Support:

Debugging Complexities:

Code Visibility:

Lack of Type Safety

Maintainability of Large Projects:

SEO Limitations:


Q 4. javascript hello world program


<!DOCTYPE html>

<html>

<head>

  <title>Hello, World! Example</title>

</head>

<body>

  <!-- A script tag to include the JavaScript code -->

  <script>

    // JavaScript code

    console.log("Hello, World!");

  </script>

</body>

</html> 


Q 5. JavaScript case sensitive language or not


Yes, JavaScript is a case-sensitive language

example :- variables named myVariable, myvariable, and MYVARIABLE are considered three distinct variables in JavaScript

// Case-sensitive variable names

let myVariable = "Hello";

let myvariable = "World";

 

console.log(myVariable); // Output: "Hello"

console.log(myvariable); // Output: "World"

 

// Case-sensitive function names

function myFunction() 

{

  console.log("This is my function.");

}

 

function myfunction() {

  console.log("This is another function.");

}

 

myFunction(); // Output: "This is my function."

myfunction(); // Output: "This is another function."


Q 6. what is bom ?


BOM stands for Browser Object Model. It is a set of APIs (Application Programming Interfaces) provided by web browsers to interact with and manipulate the browser window or tab.


Window Object:

Document Object:

Navigator Object.

 History Object:

Screen Object:

example:- 

<!DOCTYPE html>

<html>

<head>

  <title>BOM Example</title>

</head>

<body>

  <script>

    // Using the BOM to display an alert box

    window.alert("Hello, BOM!");

  </script>

</body>

</html>


Q 7. what is dom


DOM stands for Document Object Model. It is a programming interface provided by web browsers that allows JavaScript and other scripting languages to interact with the content and structure of HTML and XML documents.

Tree Structure:

Access and Manipulation:

Event Handling:.

 Dynamic Updates:

Cross-platform Compatibility:


Q 8. create objects in JavaScript

create objects in JavaScript

        A) Object Literal:

           const person = {

           name: 'John',

           age: 30,

          gender: 'male',

                    };

   B) Object Constructor Function:

       function Person(name, age, gender)

       {

             this.name = name;

            this.age = age;

            this.gender = gender;

       }

 

           const person = new Person('John', 30, 'male');


C)       Class Syntax (ES6):

           class Person

           {

              constructor(name, age, gender)

           {

               this.name = name;

               this.age = age;

               this.gender = gender;

             }

             }

       const person = new Person('John', 30, 'male');

D)  Object.create():

      const personPrototype =

      {

         greet: function()

        {

          return `Hello, my name is ${this.name}.`;

         }

         };

 

      const person = Object.create(personPrototype);

      person.name = 'John';

      person.age = 30;

      person.gender = 'male';

 

      console.log(person.greet()); // Output: "Hello, my name is John."

E) Factory Function:

       function createPerson(name, age, gender)

       {

            return

       {

            name: name,

           age: age,

           gender: gender,

        };

        }

 

       const person1 = createPerson('John', 30, 'male');

       const person2 = createPerson('Alice', 25, 'female');


Q 9. create array in javascript

    A)  Array Literal Syntax:

       const fruits = ['apple', 'orange', 'banana'];

   B)   Array Constructor:

        const numbers = new Array(1, 2, 3, 4, 5);

   C)  Accessing Elements:

       const fruits = ['apple', 'orange', 'banana'];

      console.log(fruits[0]); // Output: 'apple'

      console.log(fruits[1]); // Output: 'orange'

   D)  Modifying Elements:

        const numbers = [1, 2, 3, 4, 5];

        numbers[2] = 10;

        console.log(numbers); // Output: [1, 2, 10, 4, 5]

    E)  Array Methods:

         const numbers = [1, 2, 3];

        numbers.push(4); // [1, 2, 3, 4]

        numbers.pop();   // [1, 2, 3]

    F)  Array Length:

        const fruits = ['apple', 'orange', 'banana'];

        console.log(fruits.length); // Output: 3

2023 javascript interview questions मै हमने यहाँ कुछ सवाल पर चर्चा किया ................और पढ़े 

👇👇👇👇👇👇👇👇👇👇👇👇👇

Programming Interview Questions 

dot net framework - dot net framework download


एक टिप्पणी भेजें

0 टिप्पणियाँ