Open In App

How to detect whether a device is iOS without using Regular Expression in JavaScript?

The task is to detect whether the device is iOS or not without using RegExp with the help of JavaScript. There are two approaches that are discussed below.

Approach 1: Use navigator.platform property to check for the particular keywords which belongs to iOS devices using indexOf() method.

Approach 2: Use navigator.platform property to check for the particular keywords from the list Which belongs to iOS devices. Use pop() method to take out one by one and compare them.


Article Tags :