Skip to content

Commit 6e021d2

Browse files
authored
Question-Answer-58-60
1 parent 9035580 commit 6e021d2

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
| 55 | [If Javascript is single threaded, how it supports asynchronous operations](#55-if-javascript-is-single-threaded-how-it-supports-asynchronous-operations) |
6363
| 56 | [What is javascript scope](#56-what-is-javascript-scope) |
6464
| 57 | [Difference between global scope and local scope](#57-difference-between-global-scope-and-local-scope) |
65-
65+
| 58 | [What are the different ways to convert a string to an integer](#58-what-are-the-different-ways-to-convert-a-string-to-an-integer) |
66+
| 59 | [How to find the operating system in the client machine using JavaScript](#59-how-to-find-the-operating-system-in-the-client-machine-using-javascript) |
67+
| 60 | [Name some JavaScript frameworks and libraries](#60-name-some-javascript-frameworks-and-libraries) |
6668

6769
### 1. What is JavaScript
6870
* JavaScript is a scripting language used to create dynamic and interactive websites. It is supported by all major web browsers.
@@ -919,6 +921,33 @@ console.log(name); // ReferenceError: name is not defined
919921
```
920922
**[:top: Scroll to Top](#javascript-interview-questions)**
921923
924+
### 58. What are the different ways to convert a string to an integer
925+
926+
**1. parseInt()** - This function takes a string and an optional radix (a number between 2 and 36 that represents the base in a numeral system) as its arguments.
927+
```js
928+
console.log(parseInt("20")); // output ========> 20
929+
console.log(parseInt("52", 8)); // output ========> 42
930+
```
931+
**2. unary plus operator (+)** - This operator converts a string into a number and it should be placed before the operand.
932+
```js
933+
console.log(+"10"); // output ========> 10
934+
```
935+
**3. Number()** - It is a built-in function which converts its argument to a number. If the argument is a string that contains non-numeric characters, then it returns NaN.
936+
```js
937+
Number("10"); // output ========> 10
938+
Number("abc"); // output ========> NaN
939+
```
940+
941+
### 59. How to find the operating system in the client machine using JavaScript
942+
We can use the **navigator.platform** property to find out the operating system of the client machine
943+
```js
944+
console.log(navigator.platform); // output ========> 'Linux x86_64'
945+
```
946+
947+
### 60. Name some JavaScript frameworks and libraries
948+
**Frameworks** - Angular, Ember.js, Vue.js, Meteor, Next.js
949+
**Libraries** - React, Backbone.js
950+
922951
## Output Based Questions
923952
924953
**1. What will be the output**

0 commit comments

Comments
 (0)