const candidate = new RTCIceCandidate({
candidate: "",
sdpMid: "0",
sdpMLineIndex: 0,
});
const json = candidate.toJSON();
console.log(json); // A plain object
console.log(typeof json); // "object"
console.log(json.candidate); // Same value as candidate.candidateRTCIceCandidate: toJSON() method / notebook
RTCIceCandidate: toJSON() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const jsonString = JSON.stringify(candidate);
console.log(jsonString);