+ 1

Casting an obeject in javascript

As I know we can not cast an object in javascript, but is there any other way around it?

22nd Nov 2020, 7:06 AM
Khaled ^^ خالد القريشي‎
Khaled ^^ خالد القريشي‎ - avatar
1 ответ
+ 5
Other way around what? You should provide an example. We can explicitly convert values to a certain type in JavaScript. E.g: var s = "25" var n = Number(s) But this depends on the types involved. Can you share the code where you need to "cast" an object?
23rd Nov 2020, 4:34 AM
Kevin ★