input: Write a python function to filter a dictionary based on a list of fields.
  assert filter_json_data({"name": "Alice", "age": 30, "city": "Wonderland"}, ["name", "city"]) == {"name": "Alice", "city": "Wonderland"}
  assert filter_json_data({"name": "Bob", "age": 25, "country": "USA"}, ["age"]) == {"age": 25}
  assert filter_json_data({"username": "charlie", "password": "1234", "email": "charlie@example.com"}, ["username", "email"]) == {"username": "charlie", "email": "charlie@example.com"}
output: def filter_json_data(data, fields):
      return {key: data[key] for key in fields if key in data}