js convert double to int code example Example: js convert double to int var num = 2.9 console.log(parseInt(num, 10)); // 2