1.

For converting string to array we can use ______________ method.(a) charAt()(b) charCodeAt()(c) split()(d) toLowerCase()This question was addressed to me in final exam.The origin of the question is Essential JavaScript and jQuery in portion HTML Tables, Javascript & Jquery Basics of HTML

Answer»

Right answer is (c) split()

The EXPLANATION: For converting any string to an ARRAY we use split() method. E.g. var tr=”t,o,I,k,l”; tr.split(“,”); tr.split(“|”); tr.split(“ ”); charAt returns a character from the given INDEX, charCodeAt() returns Unicode of character at the given index. toLowerCase() method converts input string into LOWER case string.



Discussion

No Comment Found

Related InterviewSolutions