This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import boto3 | |
| client = boto3.client('lambda') | |
| def lambda_handler(event, context): | |
| inputForInvoker = {'Id': '1', 'Price': 100 } | |
| response = client.invoke( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from "react"; | |
| const Controlled = () => { | |
| const [inputText, setInputText] = useState(""); | |
| const handleSubmit = (e) => { | |
| e.preventDefault(); | |
| console.log(inputText); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const arr = [1, [7, 8], 2, 3, 4, 5, [6, 9, 10]]; | |
| const flat = [].concat(...arr); | |
| console.log(flat); // output: [1, 7, 8, 2, 3, 4, 5, 6, 9, 10] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const str = 'Hello World'; | |
| console.log(str.charAt(0)); // output: H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const isEven = (num) => num % 2 === 0; | |
| const filtered = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].filter(isEven); | |
| console.log(filtered); // output: [10, 12, 14, 16, 18, 20] |