getMyDate(el.createdAt)
import {getMyDate} from "../../../../commons/libraries/---"
--> myDate only exists inside the (bracket).
โ๏ธ Argument (์ธ์)
aaa(3,4)
โ๏ธ 3 and 4 are arguments.
๐ Parameter (๋งค๊ฐ๋ณ์)
function add (a,b){ console.log(a+b) }
โ๏ธ a+b is a parameter.
โ๏ธ Making one page and importing objects or functions to the other
โ๏ธ But if there are two separate pages without any connections, it might be hard to edit both sides to make sure they look the same. Also, it is a wrong way to make two similar pages with separate components.
๐ New page and edit page must be the parent component and use props to edit details.
//New Page
import Example from '../../src/components/units/08-example/Example.container'
export default function ExampleNewPage(){
return(
<Example aaa={false}/>
//just <Example/> is okay if aaa={true} is created in edit page
)
}
import Example from '../../src/components/units/08-example/Example.container.js'
export default function ExampleEditPage(){
return(
<Example aaa={true}/>
)
}
import ExampleUI from './Example.presenter'
export default function Example(props){
return(
<ExampleUI aaa = {props.aaa}/>
)
}
export default function ExampleUI(props){
return(
<div>
<h1>{props.aaa ? "edit" : "post"}ํ์ด์ง</h1>
์ ๋ชฉ: <input type="text"/><br/>
๋ด์ฉ: <input type="text"/><br/>
<button>Do {props.aaa ? "edit" : "post"}</button>
// if props.aaa=== true, "Do edit" ':'(if not) "Do Post"
</div>
)
}
โก๏ธ Used when there exists numerous addresses in one program.
โก๏ธ Basically just creating a table
<table>
: table tag is like a body tag
</table>
)<th>
: (table head) header cell
<tr>
: (table row) standard cell
<td>
: (table data) standard cell
<td/>
x4function solution(seoul) {
let x =0;
for (let i=0; i<seoul.length; i++){
console.log(i, seoul[i])
if (seoul[i] ==="Kim"){
x =i;
}
}
return `๊น์๋ฐฉ์ ${x}์ ์๋ค`;
}
function solution(s) {
if (s.length === 4 || s.length === 6){
for (let i= 0; i<s.length;i++){
if (isNaN(s[i])){
return false;
}
else {
return true;
}
}
}
}
๐งฉ isNaN()
function solution(n) {
let answer = 0;
for (let i=0; i<=n; i++){
if (n%i===0){
answer += i
}
}
return answer;
}