Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李楚霏
/
refactorTest
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e02e29ff
authored
Jan 23, 2020
by
李楚霏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task2 重命名变量
parent
5928922d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
length/src/index.js
+8
-8
No files found.
length/src/index.js
View file @
e02e29ff
...
...
@@ -16,31 +16,31 @@ export class Length {
return
this
.
unit
}
parseTo
(
unitNode
)
{
let
len
=
this
let
unitLength
=
this
if
(
this
.
unit
===
'yard'
)
{
if
(
unitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
*
3
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
*
3
,
unitNode
)
}
else
if
(
unitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
36
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
*
36
,
unitNode
)
}
}
if
(
this
.
unit
===
'inch'
)
{
if
(
unitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
36
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
/
36
,
unitNode
)
}
else
if
(
unitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
/
12
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
/
12
,
unitNode
)
}
}
if
(
this
.
unit
===
'f'
)
{
if
(
unitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
3
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
/
3
,
unitNode
)
}
else
if
(
unitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
12
,
unitNode
)
unitLength
=
new
Length
(
this
.
value
*
12
,
unitNode
)
}
}
return
len
return
unitLength
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment