Capture a screenshot without shadow on macOS

When taking a screenshot with the combination of <kbd>cmd</kbd> + <kbd>shift</kbd> + <kbd>4</kbd>, macOS adds a shadow to the screenshot automatically.
If you don't want to have the shadow, then after pressing the combination keys above, pressing and holding the <kbd>alt</kbd> + <kbd>space</kbd> keys. Then clicking the target window will produce a screenshot without the shadow.
The shadowless screenshot below is an example when capturing the 1 LOC website:
Remove the shadow
Remove the shadow

See also