![]() If(!str || typeof str != 'string' || str. Using this array is like using string buffer in some server side languages. if string is null or other than string this will fail. i can use an array and also add some checking. Is there any different way, you can reverse a string?Īnswer: sure. Interviewer: You know concatenation performed well in modern browsers but becomes slow in older browsers like IE8. Question: How would you reverse a string in JavaScript?Īnswer: I can loop through the string and concatenate letters to a new string try 1 If you are not applying for a Research post, you would be alright. Decision: divisor would be less than Math.sqrt (n)ĭon't worry! if you didnt get it.It is not divisible by 5, divisor should be less than 127/5 approximately 25 not by 7. ![]() So, you will check up to 127/3 approximately 42. 127 is not divisible by 2 hence you should check upto 63.5.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |