JavaScript has two distinct ways of representing missing information:
null indicates an intentional absence stored in a property that exists.
undefined appears when we read an optional property that was not defined on the object.
In input, you receive a person's registration record:
nombre: non-empty string of 1 to 40 characters.
correo: property that is always present and holds either a non-empty string (1 to 100 characters) or null.
apodo: optional property that may be absent from input, or be a non-empty string of 1 to 30 characters (never null).
activo: boolean value (true or false).
Return an object with exactly seven properties:
nombre: the original name received.
tipoCorreo: result of typeof input.correo (notice that when correo is null, typeof returns "object").
tipoApodo: result of typeof input.apodo ("string" when present or "undefined" when absent).
tieneCorreo: boolean obtained from the strict comparison input.correo !== null.
tieneApodo: boolean obtained from the strict comparison input.apodo !== undefined.
activo: the original boolean received in input.activo.
datosCompletos: boolean indicating whether both email and nickname are present (tieneCorreo && tieneApodo), regardless of whether activo is true or false.
Rules and constraints
Distinguish null from undefined: do not confuse null with undefined, and do not assume typeof input.correo === "object" means an email is registered.
Independence of activo: an active registration (activo: true) may have incomplete data, and an inactive one (activo: false) may have datosCompletos: true.
Allowed tools: use typeof, strict inequality comparisons (!==), the logical && operator, and return. Do not use if, else, switch, ternary operators, loops, array methods, classes, or helper functions.
Contract
Complete function solve(input) and return the resulting object (no property in the output may be undefined). The input always satisfies the described constraints. Do not use network calls, files, imports, packages, or asynchronous code.