MCQs > IT & Programming > JavaScript > Consider parsing a URL with the following code snippet? var reg = /(\w+):\/\/([\w.]+)\/(\S*)/; var url = 'http://www.myblog.com/'; var result = url.match(reg); if (result != null) { var path = result[1]; }

JavaScript MCQs

Consider parsing a URL with the following code snippet?

var reg = /(\w+):\/\/([\w.]+)\/(\S*)/; var url = "http://www.myblog.com/"; var result = url.match(reg); if (result != null) { var path = result[1]; }

Answer

Correct Answer: http

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it