Complete the code to create a new frame in Figma using the API.
const frame = figma.create[1]();In Figma API, createFrame() creates a new frame node.
Complete the code to set the width of a frame to 300 pixels.
frame.[1] = 300;
The width property sets the frame's width in pixels.
Fix the error in the code to resize a frame proportionally by setting its height to 200 pixels while keeping the aspect ratio.
const aspectRatio = frame.width / frame.[1]; frame.height = 200; frame.width = 200 * aspectRatio;
The aspect ratio is width divided by height, so frame.height is needed.
Fill both blanks to set the frame's size to 400x300 pixels.
frame.[1] = 400; frame.[2] = 300;
Use width and height properties to set frame size.
Fill all three blanks to create a frame, set its width to 500, and add it to the current page.
const frame = figma.[1](); frame.[2] = 500; figma.currentPage.[3](frame);
Create a frame with createFrame(), set width with width, and add it to the page with appendChild().
