Malicious jamming attacks have been regarded as a serious threat to Internet of Things (IoT) networks, which can significantly degrade the quality of service (QoS) of users. This paper utilizes an intelligent reflecting surface (IRS) to enhance anti-jamming performance due to its capability in reconfiguring the wireless propagation environment via dynamicly adjusting each IRS reflecting elements. To enhance the communication performance against jamming attacks, a robust beamforming optimization problem is formulated in a multiuser IRS-assisted anti-jamming communications scenario with or without imperfect jammer's channel state information (CSI). In addition, we further consider the fact that the jammer's transmit beamforming can not be known at BS. Specifically, with no knowledge of jammers transmit beamforming, the total transmit power minimization problems are formulated subject to the outage probability requirements of legitimate users with the jammer's statistical CSI, and signal-to-interference-plus-noise ratio (SINR) requirements of legitimate users without the jammer's CSI, respectively. By applying the Decomposition-based large deviation inequality (DBLDI), Bernstein-type inequality (BTI), Cauchy-Schwarz inequality, and penalty non-smooth optimization method, we efficiently solve the initial intractable and non-convex problems. Numerical simulations demonstrate that the proposed antijamming approaches achieve superior anti-jamming performance and lower power-consumption compared to the non-IRS scheme and reveal the impact of key parameters on the achievable system performance.