Posts

Showing posts from April, 2024

Computer Science Exam MCQs - Part 1

1. CD, DVD, and floppy disk are all examples of; a- storage media b- input devices c- output devices d- both b and c e- none of the above 2. Typically the size of a compact disk (CD) in diameter is about; a- 2.6 inches b- 3.2 inches c- 3.8 inches d-  4.7 inches e-  5.3 inches 3. How many concurrent users approximately  can a server handle? a- 250 b- 400 c- 450 d- 500 e- depends on several factors 4. The storage capacity of a compact disk (CD) is about; a- 500 MB b- 700 MB c- 1000 MB d- 1 GB e- 1.5 GB 5. What is the maximum storage capacity of a floppy disk? a- 80 kilobytes b-  144 kilobytes c-  500 kilobytes d- 1.44 megabytes e- 7  megabytes 6. Microsoft Corporation developed the Disk Operating System (DOS) for the IBM Personal Computer in; a- 1981 b- 1975 c- 1985 d- 1991 e- 1995 7. Which of the following area performs hazardous tasks with the help of computerized robotic arms? a- ICU in hospitals  b- film shooting industry  c- manufacturing industries d- construction companies e- oil

The arguments object in JavaScript

The arguments object in JavaScript is a function-specific local variable that provides access to the arguments passed to that function when it was called. However, it's important to note that the arguments object has some limitations and is generally considered less preferred in modern JavaScript for several reasons. Here's a breakdown of the arguments object: Availability: The arguments object is available within all non-arrow functions. Arrow functions do not have a built-in arguments object. Properties: The arguments object is array-like , meaning it has a length property (indicating the number of arguments passed) and allows indexing using numerical positions (similar to arrays). However, it does not have the full functionality of a true array and cannot be used with standard array methods like map or forEach. Limitations: Not a real array: As mentioned, the arguments object lacks the methods and behavior of a true array. Live collection: The arguments object is a live co

Common Array methods in JavaScript that modify the array in place

The following are the common array methods in JavaScript that modify the original array instead of returning a new one: 1. pop():  Removes and returns the last element from an array. Example: myArray.pop(); 2. push():  Adds one or more elements to the end of an array and returns the new length of the array. Example: myArray.push(element1, element2); 3. shift():  Removes and returns the first element from an array. Example: myArray.shift(); 4. unshift():   Adds one or more elements to the beginning of an array and returns the new length of the array. Example: myArray.unshift(element1, element2); 5. splice():  This is a versatile method that can be used to: Remove elements from an array (splice(start, deleteCount)) Add elements to an array (splice(start, 0, element1, element2)) Replace elements in an array (splice(start, deleteCount, element1, element2)) Example: myArray.splice(2, 1); // Removes one element at index 2 myArray.splice(1, 0, 'newElement'); // Adds 'newElement