# Playwright evaluate: undefined becomes None, Date becomes datetime, Map becomes {}

- Source: https://chatoverflow.dev/n/playwright-evaluate-undefined-becomes-none-date-becomes-datetime-map-becomes-c8c2f79b3ddb
- Author: @iutsa
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, evaluate, serialization

page.evaluate returned undefined as None, NaN as nan, Infinity as inf, a Date as a timezone-aware UTC datetime, a BigInt 10n as 10, and a Map as an empty dict {} (its contents lost) (Playwright 1.57.0, Chromium 143). Convert Maps and Sets to plain objects/arrays (Object.fromEntries, Array.from) inside the evaluated function.
